* [PATCH 1/1] block/bio.c: use GFP_NOFS
@ 2014-06-14 20:57 Fabian Frederick
2014-06-16 0:28 ` Hugh Dickins
0 siblings, 1 reply; 3+ messages in thread
From: Fabian Frederick @ 2014-06-14 20:57 UTC (permalink / raw)
To: linux-kernel; +Cc: Fabian Frederick, Jens Axboe
Use GFP_NOFS instead of its definition.
Cc: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Fabian Frederick <fabf@skynet.be>
---
block/bio.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/block/bio.c b/block/bio.c
index 8c2e55e..ec5d172 100644
--- a/block/bio.c
+++ b/block/bio.c
@@ -211,7 +211,7 @@ fallback:
bvl = mempool_alloc(pool, gfp_mask);
} else {
struct biovec_slab *bvs = bvec_slabs + *idx;
- gfp_t __gfp_mask = gfp_mask & ~(__GFP_WAIT | __GFP_IO);
+ gfp_t __gfp_mask = gfp_mask & ~GFP_NOFS;
/*
* Make this allocation restricted and don't dump info on
--
1.8.4.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 1/1] block/bio.c: use GFP_NOFS
2014-06-14 20:57 [PATCH 1/1] block/bio.c: use GFP_NOFS Fabian Frederick
@ 2014-06-16 0:28 ` Hugh Dickins
2014-06-16 15:12 ` Jens Axboe
0 siblings, 1 reply; 3+ messages in thread
From: Hugh Dickins @ 2014-06-16 0:28 UTC (permalink / raw)
To: Fabian Frederick; +Cc: linux-kernel, Jens Axboe
On Sat, 14 Jun 2014, Fabian Frederick wrote:
> Use GFP_NOFS instead of its definition.
>
> Cc: Jens Axboe <axboe@kernel.dk>
> Signed-off-by: Fabian Frederick <fabf@skynet.be>
> ---
> block/bio.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/block/bio.c b/block/bio.c
> index 8c2e55e..ec5d172 100644
> --- a/block/bio.c
> +++ b/block/bio.c
> @@ -211,7 +211,7 @@ fallback:
> bvl = mempool_alloc(pool, gfp_mask);
> } else {
> struct biovec_slab *bvs = bvec_slabs + *idx;
> - gfp_t __gfp_mask = gfp_mask & ~(__GFP_WAIT | __GFP_IO);
> + gfp_t __gfp_mask = gfp_mask & ~GFP_NOFS;
>
> /*
> * Make this allocation restricted and don't dump info on
> --
> 1.8.4.5
Please no. The original was fine, this just makes it harder to read.
GFP_NOFS is a useful and widely used combination of flags for passing
down to the page allocator; but it is merely obscure when used as you
have for masking bits off.
(But I confess to hypocrisy in finding "& ~GFP_KERNEL" useful myself
in the past somewhere.)
Hugh
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 1/1] block/bio.c: use GFP_NOFS
2014-06-16 0:28 ` Hugh Dickins
@ 2014-06-16 15:12 ` Jens Axboe
0 siblings, 0 replies; 3+ messages in thread
From: Jens Axboe @ 2014-06-16 15:12 UTC (permalink / raw)
To: Hugh Dickins, Fabian Frederick; +Cc: linux-kernel
On 2014-06-15 18:28, Hugh Dickins wrote:
> On Sat, 14 Jun 2014, Fabian Frederick wrote:
>
>> Use GFP_NOFS instead of its definition.
>>
>> Cc: Jens Axboe <axboe@kernel.dk>
>> Signed-off-by: Fabian Frederick <fabf@skynet.be>
>> ---
>> block/bio.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/block/bio.c b/block/bio.c
>> index 8c2e55e..ec5d172 100644
>> --- a/block/bio.c
>> +++ b/block/bio.c
>> @@ -211,7 +211,7 @@ fallback:
>> bvl = mempool_alloc(pool, gfp_mask);
>> } else {
>> struct biovec_slab *bvs = bvec_slabs + *idx;
>> - gfp_t __gfp_mask = gfp_mask & ~(__GFP_WAIT | __GFP_IO);
>> + gfp_t __gfp_mask = gfp_mask & ~GFP_NOFS;
>>
>> /*
>> * Make this allocation restricted and don't dump info on
>> --
>> 1.8.4.5
>
> Please no. The original was fine, this just makes it harder to read.
I agree. GFP_NOFS is useful when it's used as a whole, but for this use
case, explicitly saying that we want to wait for mem and we allow IO is
much clearer. The fact that this just happens to be GFP_NOFS doesn't
really matter.
> (But I confess to hypocrisy in finding "& ~GFP_KERNEL" useful myself
> in the past somewhere.)
That's just sick, Hugh :-)
--
Jens Axboe
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-06-16 15:12 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-14 20:57 [PATCH 1/1] block/bio.c: use GFP_NOFS Fabian Frederick
2014-06-16 0:28 ` Hugh Dickins
2014-06-16 15:12 ` Jens Axboe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).