From: Matthew Wilcox <willy@infradead.org>
To: Christoph Hellwig <hch@infradead.org>
Cc: Hannes Reinecke <hare@suse.de>,
Bart Van Assche <Bart.VanAssche@wdc.com>,
"axboe@kernel.dk" <axboe@kernel.dk>,
"linux-mm@kvack.org" <linux-mm@kvack.org>,
"martin@lichtvoll.de" <martin@lichtvoll.de>,
"oleksandr@natalenko.name" <oleksandr@natalenko.name>,
"linux-block@vger.kernel.org" <linux-block@vger.kernel.org>
Subject: Re: Block layer use of __GFP flags
Date: Mon, 9 Apr 2018 08:11:47 -0700 [thread overview]
Message-ID: <20180409151147.GA11756@bombadil.infradead.org> (raw)
In-Reply-To: <20180409082650.GA869@infradead.org>
On Mon, Apr 09, 2018 at 01:26:50AM -0700, Christoph Hellwig wrote:
> On Mon, Apr 09, 2018 at 08:53:49AM +0200, Hannes Reinecke wrote:
> > Why don't you fold the 'flags' argument into the 'gfp_flags', and drop
> > the 'flags' argument completely?
> > Looks a bit pointless to me, having two arguments denoting basically
> > the same ...
>
> Wrong way around. gfp_flags doesn't really make much sense in this
> context. We just want the plain flags argument, including a non-block
> flag for it.
Look at this sequence from scsi_ioctl.c:
if (bytes) {
buffer = kzalloc(bytes, q->bounce_gfp | GFP_USER| __GFP_NOWARN);
if (!buffer)
return -ENOMEM;
}
rq = blk_get_request(q, in_len ? REQ_OP_SCSI_OUT : REQ_OP_SCSI_IN,
__GFP_RECLAIM);
That makes no damn sense. If the buffer can be allocated using GFP_USER,
then the request should also be allocatable using GFP_USER. In the current
tree, that (wrongly) gets translated into __GFP_DIRECT_RECLAIM.
next prev parent reply other threads:[~2018-04-09 15:11 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-08 6:54 Block layer use of __GFP flags Matthew Wilcox
2018-04-08 16:40 ` Bart Van Assche
2018-04-08 19:08 ` Matthew Wilcox
2018-04-09 4:46 ` Bart Van Assche
2018-04-09 6:53 ` Hannes Reinecke
2018-04-09 8:26 ` Christoph Hellwig
2018-04-09 15:11 ` Matthew Wilcox [this message]
2018-04-09 15:15 ` Bart Van Assche
2018-04-09 9:00 ` Michal Hocko
2018-04-09 15:03 ` Bart Van Assche
2018-04-09 17:31 ` Michal Hocko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180409151147.GA11756@bombadil.infradead.org \
--to=willy@infradead.org \
--cc=Bart.VanAssche@wdc.com \
--cc=axboe@kernel.dk \
--cc=hare@suse.de \
--cc=hch@infradead.org \
--cc=linux-block@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=martin@lichtvoll.de \
--cc=oleksandr@natalenko.name \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).