linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: David Hildenbrand <david@redhat.com>
To: "Liam R. Howlett" <Liam.Howlett@oracle.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	syzbot+3511625422f7aa637f0d@syzkaller.appspotmail.com,
	stable@vger.kernel.org, Christoph Lameter <cl@linux.com>
Subject: Re: [PATCH v1] mm/mempolicy: fix migrate_to_node() assuming there is at least one VMA in a MM
Date: Fri, 22 Nov 2024 15:57:58 +0100	[thread overview]
Message-ID: <7e6c2c57-d633-4052-95a9-31ccc9c66327@redhat.com> (raw)
In-Reply-To: <m4p5ngz7l4hgavwysczmliqrgumlx6dxg35jjwlpcmqtzrpmsk@q2wwxruumhrl>

On 22.11.24 15:44, Liam R. Howlett wrote:
> * David Hildenbrand <david@redhat.com> [241122 04:32]:
>> On 22.11.24 07:19, Andrew Morton wrote:
>>> On Wed, 20 Nov 2024 15:27:46 -0500 "Liam R. Howlett" <Liam.Howlett@oracle.com> wrote:
>>>
>>>> I hate the extra check because syzbot can cause this as this should
>>>> basically never happen in real life, but it seems we have to add it.
>>>
>>> So..
>>>
>>> --- a/mm/mempolicy.c~mm-mempolicy-fix-migrate_to_node-assuming-there-is-at-least-one-vma-in-a-mm-fix
>>> +++ a/mm/mempolicy.c
>>> @@ -1080,7 +1080,7 @@ static long migrate_to_node(struct mm_st
>>>    	mmap_read_lock(mm);
>>>    	vma = find_vma(mm, 0);
>>> -	if (!vma) {
>>> +	if (unlikely(!vma)) {
>>>    		mmap_read_unlock(mm);
>>>    		return 0;
>>>    	}
>>> _
>>>
>>> ?
>>
>> Why not, at least for documentation purposes. Because I don't think this is
>> any fast-path we really care about, so expect the runtime effects to be
>> mostly negligible. Thanks!
> 
> The next email we get about this will be a bot with a micro benchmark
> performance drop.

I'll be pleasantly surprised if our migration code is that fast such 
that this here would matter :)

-- 
Cheers,

David / dhildenb



      reply	other threads:[~2024-11-22 14:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-20 20:11 David Hildenbrand
2024-11-20 20:27 ` Liam R. Howlett
2024-11-20 20:49   ` David Hildenbrand
2024-11-22  6:19   ` Andrew Morton
2024-11-22  9:32     ` David Hildenbrand
2024-11-22 14:44       ` Liam R. Howlett
2024-11-22 14:57         ` David Hildenbrand [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=7e6c2c57-d633-4052-95a9-31ccc9c66327@redhat.com \
    --to=david@redhat.com \
    --cc=Liam.Howlett@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=cl@linux.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=stable@vger.kernel.org \
    --cc=syzbot+3511625422f7aa637f0d@syzkaller.appspotmail.com \
    /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