Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 592100 Details for
Bug 832252
cifs_async_writev blocked by limited kmap on i386 with high-mem
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
patch -- serialize kmaps in async writev marshalling code
0001-BZ-832252-cifs-when-CONFIG_HIGHMEM-is-set-serialize-.patch (text/plain), 3.64 KB, created by
Jeff Layton
on 2012-06-15 11:01:38 UTC
(
hide
)
Description:
patch -- serialize kmaps in async writev marshalling code
Filename:
MIME Type:
Creator:
Jeff Layton
Created:
2012-06-15 11:01:38 UTC
Size:
3.64 KB
patch
obsolete
>From bdd2e029981f24c6ed94f30b7626bf1b5011a752 Mon Sep 17 00:00:00 2001 >From: Jeff Layton <jlayton@redhat.com> >Date: Fri, 15 Jun 2012 06:55:01 -0400 >Subject: [RHEL6 PATCH] BZ#832252: cifs: when CONFIG_HIGHMEM is set, serialize the read/write kmaps > >Jian found that when he ran fsx on a 32 bit arch with a large wsize the >process and one of the bdi writeback kthreads would sometimes deadlock >with a stack trace like this: > >crash> bt >PID: 2789 TASK: f02edaa0 CPU: 3 COMMAND: "fsx" > #0 [eed63cbc] schedule at c083c5b3 > #1 [eed63d80] kmap_high at c0500ec8 > #2 [eed63db0] cifs_async_writev at f7fabcd7 [cifs] > #3 [eed63df0] cifs_writepages at f7fb7f5c [cifs] > #4 [eed63e50] do_writepages at c04f3e32 > #5 [eed63e54] __filemap_fdatawrite_range at c04e152a > #6 [eed63ea4] filemap_fdatawrite at c04e1b3e > #7 [eed63eb4] cifs_file_aio_write at f7fa111a [cifs] > #8 [eed63ecc] do_sync_write at c052d202 > #9 [eed63f74] vfs_write at c052d4ee >#10 [eed63f94] sys_write at c052df4c >#11 [eed63fb0] ia32_sysenter_target at c0409a98 > EAX: 00000004 EBX: 00000003 ECX: abd73b73 EDX: 012a65c6 > DS: 007b ESI: 012a65c6 ES: 007b EDI: 00000000 > SS: 007b ESP: bf8db178 EBP: bf8db1f8 GS: 0033 > CS: 0073 EIP: 40000424 ERR: 00000004 EFLAGS: 00000246 > >Each task would kmap part of its address array before getting stuck, but >not enough to actually issue the write. > >This patch fixes this by serializing the marshal_iov operations for >async reads and writes. The idea here is to ensure that cifs >aggressively tries to populate a request before attempting to fulfill >another one. As soon as all of the pages are kmapped for a request, then >we can unlock and allow another one to proceed. > >There's no need to do this serialization on non-CONFIG_HIGHMEM arches >however, so optimize all of this out when CONFIG_HIGHMEM isn't set. > >Reported-by: Jian Li <jiali@redhat.com> >Signed-off-by: Jeff Layton <jlayton@redhat.com> >--- > fs/cifs/cifssmb.c | 28 ++++++++++++++++++++++++++++ > 1 files changed, 28 insertions(+), 0 deletions(-) > >diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c >index b485659..ff69808 100644 >--- a/fs/cifs/cifssmb.c >+++ b/fs/cifs/cifssmb.c >@@ -82,6 +82,32 @@ static struct { > #endif /* CONFIG_CIFS_WEAK_PW_HASH */ > #endif /* CIFS_POSIX */ > >+#ifdef CONFIG_HIGHMEM >+/* >+ * On arches that have high memory, kmap address space is limited. By >+ * serializing the kmap operations on those arches, we ensure that we don't >+ * end up with a bunch of threads in writeback with partially mapped page >+ * arrays, stuck waiting for kmap to come back. That situation prevents >+ * progress and can deadlock. >+ */ >+static DEFINE_MUTEX(cifs_kmap_mutex); >+ >+static inline void >+cifs_kmap_lock(void) >+{ >+ mutex_lock(&cifs_kmap_mutex); >+} >+ >+static inline void >+cifs_kmap_unlock(void) >+{ >+ mutex_unlock(&cifs_kmap_mutex); >+} >+#else /* !CONFIG_HIGHMEM */ >+#define cifs_kmap_lock() do { ; } while(0) >+#define cifs_kmap_unlock() do { ; } while(0) >+#endif /* CONFIG_HIGHMEM */ >+ > /* Mark as invalid, all open files on tree connections since they > were closed when session to server was lost */ > static void mark_open_files_invalid(struct cifsTconInfo *pTcon) >@@ -1801,6 +1827,7 @@ cifs_async_writev(struct cifs_writedata *wdata) > > /* marshal up the pages into iov array */ > wdata->bytes = 0; >+ cifs_kmap_lock(); > for (i = 0; i < wdata->nr_pages; i++) { > iov[i + 1].iov_len = min(inode->i_size - > page_offset(wdata->pages[i]), >@@ -1808,6 +1835,7 @@ cifs_async_writev(struct cifs_writedata *wdata) > iov[i + 1].iov_base = kmap(wdata->pages[i]); > wdata->bytes += iov[i + 1].iov_len; > } >+ cifs_kmap_unlock(); > > cFYI(1, "async write at %llu %u bytes", wdata->offset, wdata->bytes); > >-- >1.7.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 832252
:
592100
|
595703