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 695035 Details for
Bug 831158
dm-crypt: Fix possible mempool deadlock
[?]
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]
Proposed patch
0001-dm-crypt-fix-mempool-deadlock.patch (text/plain), 2.44 KB, created by
Milan Broz
on 2013-02-08 12:08:10 UTC
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Milan Broz
Created:
2013-02-08 12:08:10 UTC
Size:
2.44 KB
patch
obsolete
>From 6b97c677d5c3bf518d95110088ce9cc6b5b98509 Mon Sep 17 00:00:00 2001 >From: Milan Broz <mbroz@redhat.com> >Date: Thu, 2 Aug 2012 15:54:17 +0200 >Subject: [RHEL6.4 PATCH] dm crypt: fix mempool deadlock > >dm crypt: fix possible mempool deadlock >Resolves: 831158 > >There is no reproducer but kernel with patch tested using >intensive performance tests + cryptsetup testsuite. > >Backport of upstream commit >commit aeb2deae2660a1773c83d3c6e9e6575daa3855d6 >Author: Mikulas Patocka <mpatocka@redhat.com> > >This patch fixes a possible deadlock in dm-crypt's mempool use. > >Currently, dm-crypt reserves a mempool of MIN_BIO_PAGES reserved pages. >It allocates first MIN_BIO_PAGES with non-failing allocation (the allocation >cannot fail and waits until the mempool is refilled). Further pages are >allocated with different gfp flags that allow failing. > >Because allocations may be done in parallel, this code can deadlock. Example: >There are two processes, each tries to allocate MIN_BIO_PAGES and the processes >run simultaneously. >It may end up in a situation where each process allocates (MIN_BIO_PAGES / 2) >pages. The mempool is exhausted. Each process waits for more pages to be freed >to the mempool, which never happens. > >To avoid this deadlock scenario, this patch changes the code so that only >the first page is allocated with non-failing gfp mask. Allocation of further >pages may fail. >--- > drivers/md/dm-crypt.c | 10 ++++------ > 1 file changed, 4 insertions(+), 6 deletions(-) > >diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c >index 82b9fe3..957c08f 100644 >--- a/drivers/md/dm-crypt.c >+++ b/drivers/md/dm-crypt.c >@@ -141,7 +141,6 @@ struct crypt_config { > > #define MIN_IOS 16 > #define MIN_POOL_PAGES 32 >-#define MIN_BIO_PAGES 8 > > static struct kmem_cache *_crypt_io_pool; > >@@ -551,12 +550,11 @@ static struct bio *crypt_alloc_buffer(struct dm_crypt_io *io, unsigned size, > } > > /* >- * if additional pages cannot be allocated without waiting, >- * return a partially allocated bio, the caller will then try >- * to allocate additional bios while submitting this partial bio >+ * If additional pages cannot be allocated without waiting, >+ * return a partially-allocated bio. The caller will then try >+ * to allocate more bios while submitting this partial bio. > */ >- if (i == (MIN_BIO_PAGES - 1)) >- gfp_mask = (gfp_mask | __GFP_NOWARN) & ~__GFP_WAIT; >+ gfp_mask = (gfp_mask | __GFP_NOWARN) & ~__GFP_WAIT; > > len = (size > PAGE_SIZE) ? PAGE_SIZE : size; > >-- >1.7.10.4 >
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 831158
: 695035