From: Qi Zheng <zhengqi.arch@bytedance.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: akinobu.mita@gmail.com, dvyukov@google.com, jgg@nvidia.com,
willy@infradead.org, linux-kernel@vger.kernel.org,
linux-mm@kvack.org, linux-fsdevel@vger.kernel.org,
stable@vger.kernel.org
Subject: Re: [PATCH v3] mm: fix unexpected changes to {failslab|fail_page_alloc}.attr
Date: Sat, 19 Nov 2022 08:48:36 +0800 [thread overview]
Message-ID: <4d6eb453-2ba5-12f3-8dff-7074a62441ce@bytedance.com> (raw)
In-Reply-To: <20221118134236.17a67804b3b6e6c157d8ea02@linux-foundation.org>
On 2022/11/19 05:42, Andrew Morton wrote:
> On Fri, 18 Nov 2022 18:00:11 +0800 Qi Zheng <zhengqi.arch@bytedance.com> wrote:
>
>> When we specify __GFP_NOWARN, we only expect that no warnings
>> will be issued for current caller. But in the __should_failslab()
>> and __should_fail_alloc_page(), the local GFP flags alter the
>> global {failslab|fail_page_alloc}.attr, which is persistent and
>> shared by all tasks. This is not what we expected, let's fix it.
>>
>> Cc: stable@vger.kernel.org
>> Fixes: 3f913fc5f974 ("mm: fix missing handler for __GFP_NOWARN")
>> Reported-by: Dmitry Vyukov <dvyukov@google.com>
>> Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
>> Reviewed-by: Akinobu Mita <akinobu.mita@gmail.com>
>>
>> ...
>>
>> -bool should_fail(struct fault_attr *attr, ssize_t size)
>> +bool should_fail_ex(struct fault_attr *attr, ssize_t size, int flags)
>> {
>> bool stack_checked = false;
>>
>> @@ -152,13 +149,20 @@ bool should_fail(struct fault_attr *attr, ssize_t size)
>> return false;
>>
>> fail:
>> - fail_dump(attr);
>> + if (!(flags & FAULT_NOWARN))
>> + fail_dump(attr);
>>
>> if (atomic_read(&attr->times) != -1)
>> atomic_dec_not_zero(&attr->times);
>>
>> return true;
>> }
>> +EXPORT_SYMBOL_GPL(should_fail_ex);
>
> I don't see a need to export this?
Yes, my initial thought was that there might be a driver using this
function, but there really isn't one yet.
And I see you've helped remove this, thanks a lot. :)
>
>
--
Thanks,
Qi
prev parent reply other threads:[~2022-11-19 0:48 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-18 10:00 Qi Zheng
2022-11-18 12:47 ` Jason Gunthorpe
2022-11-18 21:42 ` Andrew Morton
2022-11-19 0:48 ` Qi Zheng [this message]
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=4d6eb453-2ba5-12f3-8dff-7074a62441ce@bytedance.com \
--to=zhengqi.arch@bytedance.com \
--cc=akinobu.mita@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=dvyukov@google.com \
--cc=jgg@nvidia.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=stable@vger.kernel.org \
--cc=willy@infradead.org \
/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