Message ID | 20130121233245.GF27093@agk-dp.fab.redhat.com (mailing list archive) |
---|---|
State | Deferred, archived |
Headers | show |
Alasdair, I've pushed changes to the thin-dev and all-caches branches of my github tree: https://github.com/jthornber/linux-2.6.git https://github.com/jthornber/linux-2.6/commit/ed52136ac238af0958b89b29749e27f049e0cb0c https://github.com/jthornber/linux-2.6/commit/cf5273fe5f4e77b3df3acdbfc6bb09ff76dafcbd https://github.com/jthornber/linux-2.6/commit/6e77ba56b8bbd21f43f00c2551c01a2e7d10aaf9 Note the mempool alloc _can_ fail with GFP_NOIO/GFP_NOWAIT. - Joe -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel
On Tue, Jan 22, 2013 at 11:31:49AM +0000, Joe Thornber wrote:
> Note the mempool alloc _can_ fail with GFP_NOIO/GFP_NOWAIT.
Not with GFP_NOIO.
include/linux/gfp.h:
#define GFP_NOIO (__GFP_WAIT)
mempool_alloc():
might_sleep_if(gfp_mask & __GFP_WAIT);
Alasdair
--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
--- a/dm-bio-prison.c 2013-01-14 19:32:36.000000000 +0000 +++ b/dm-bio-prison.c 2013-01-21 23:09:49.000000000 +0000 @@ -79,8 +79,7 @@ } EXPORT_SYMBOL_GPL(dm_bio_prison_destroy); -struct dm_bio_prison_cell * -dm_bio_prison_alloc_cell(struct dm_bio_prison *prison, gfp_t gfp) +struct dm_bio_prison_cell *dm_bio_prison_alloc_cell(struct dm_bio_prison *prison, gfp_t gfp) { return mempool_alloc(prison->cell_pool, gfp); } --- a/dm-thin.c 2013-01-18 15:00:00.000000000 +0000 +++ b/dm-thin.c 2013-01-21 23:09:48.000000000 +0000 @@ -250,16 +250,16 @@ int r; struct dm_bio_prison_cell *cell; + /* + * Allocate a cell from the prison's mempool. + * This might block but it can't fail. + */ cell = dm_bio_prison_alloc_cell(pool->prison, GFP_NOIO); - if (!cell) - return -ENOMEM; r = dm_bio_detain(pool->prison, key, bio, cell, result); - if (r) /* - * We reused an old cell, or errored; we can get rid of - * the new one. + * We reused an old cell: get rid of the new one. */ dm_bio_prison_free_cell(pool->prison, cell);