From: Jens Axboe <[email protected]>
To: Matthew Wilcox <[email protected]>
Cc: [email protected], [email protected]
Subject: Re: [PATCH 2/3] pipe: enable handling of IOCB_NOWAIT
Date: Tue, 14 Mar 2023 06:04:32 -0600 [thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
On 3/14/23 3:38?AM, Matthew Wilcox wrote:
> On Tue, Mar 07, 2023 at 08:10:32PM -0700, Jens Axboe wrote:
>> @@ -493,9 +507,13 @@ pipe_write(struct kiocb *iocb, struct iov_iter *from)
>> int copied;
>>
>> if (!page) {
>> - page = alloc_page(GFP_HIGHUSER | __GFP_ACCOUNT);
>> + gfp_t gfp = __GFP_HIGHMEM | __GFP_ACCOUNT;
>> +
>> + if (!nonblock)
>> + gfp |= GFP_USER;
>> + page = alloc_page(gfp);
>
> Hmm, looks like you drop __GFP_HARDWALL in the nonblock case. People who
> use cpusets might be annoyed by that.
Ah good catch! Yes, that's an oversight, I'll rectify that in v2.
>> if (unlikely(!page)) {
>> - ret = ret ? : -ENOMEM;
>> + ret = ret ? : nonblock ? -EAGAIN : -ENOMEM;
>
> double ternary operator? really?
yeah sorry... See reply to Christian, I'll make this cleaner.
--
Jens Axboe
next prev parent reply other threads:[~2023-03-14 12:05 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-08 3:10 [PATCHSET for-next 0/3] Add FMODE_NOWAIT support to pipes Jens Axboe
2023-03-08 3:10 ` [PATCH 1/3] fs: add 'nonblock' parameter to pipe_buf_confirm() and fops method Jens Axboe
2023-03-14 9:11 ` Christian Brauner
2023-03-08 3:10 ` [PATCH 2/3] pipe: enable handling of IOCB_NOWAIT Jens Axboe
2023-03-14 9:26 ` Christian Brauner
2023-03-14 12:03 ` Jens Axboe
2023-03-14 9:38 ` Matthew Wilcox
2023-03-14 12:04 ` Jens Axboe [this message]
2023-03-08 3:10 ` [PATCH 3/3] pipe: set FMODE_NOWAIT on pipes Jens Axboe
2023-03-14 9:26 ` Christian Brauner
2023-03-08 3:33 ` [PATCHSET for-next 0/3] Add FMODE_NOWAIT support to pipes Jens Axboe
2023-03-08 6:46 ` Dave Chinner
2023-03-08 14:30 ` Jens Axboe
-- strict thread matches above, loose matches on Subject: below --
2023-03-14 15:42 [PATCHSET v2 " Jens Axboe
2023-03-14 15:42 ` [PATCH 2/3] pipe: enable handling of IOCB_NOWAIT Jens Axboe
2023-03-15 8:23 ` Christian Brauner
2023-03-15 14:16 ` Jens Axboe
2023-03-15 15:02 ` Christian Brauner
2023-03-15 15:12 ` Jens Axboe
2023-03-15 15:16 ` Jens Axboe
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 \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
/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