Linux-mm Archive on lore.kernel.org
 help / color / Atom feed
From: "Li Xinhai" <lixinhai.lxh@gmail.com>
To: yang.shi <yang.shi@linux.alibaba.com>,  akpm <akpm@linux-foundation.org>
Cc: "linux-mm@kvack.org" <linux-mm@kvack.org>,
	 "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] mm: mempolicy: use VM_BUG_ON_VMA in queue_pages_test_walk()
Date: Thu, 16 Jan 2020 23:52:52 +0800
Message-ID: <20200116235250155994144@gmail.com> (raw)
In-Reply-To: <2a9ad6d6-af98-987a-0878-6058702db912@linux.alibaba.com>

On 2020-01-16 at 01:27 Yang Shi wrote:
>
>
>On 1/15/20 4:08 AM, Li Xinhai wrote:
>> On 2020-01-15 at 14:09 Yang Shi wrote:
>>> The VM_BUG_ON() is already used by queue_pages_test_walk(), it sounds
>>> better to dump more debug information by using VM_BUG_ON_VMA() to help
>>> debugging.
>>>
>>> Signed-off-by: Yang Shi <yang.shi@linux.alibaba.com>
>> The .test_walk() is to be called from pagewalk with the rule that 'start'
>> and 'end' must within range of vma, in case the rule is broke, we detect
>> it. This is not quite relevant to a bug of particular vma.
>
>But when you run into VMA range check failure, isn't it helpful to dump
>the VMA range information to ease debugging? And, VM_BUG_ON is already
>used in the code, I'm supposed the users may prefer more debug
>information dumped for debug kernel.
> 
Got your point, it is already used better put more information.
>>
>>> ---
>>> mm/mempolicy.c | 2 +-
>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/mm/mempolicy.c b/mm/mempolicy.c
>>> index 067cf7d..801d45d 100644
>>> --- a/mm/mempolicy.c
>>> +++ b/mm/mempolicy.c
>>> @@ -621,7 +621,7 @@ static int queue_pages_test_walk(unsigned long start, unsigned long end,
>>> unsigned long flags = qp->flags;
>>>
>>> /* range check first */
>>> -	VM_BUG_ON((vma->vm_start > start) || (vma->vm_end < end));
>>> +	VM_BUG_ON_VMA((vma->vm_start > start) || (vma->vm_end < end), vma);
>>>
>>> if (!qp->first) {
>>> qp->first = vma;
>>> --
>>> 1.8.3.1
>>>
>> >
>

      reply index

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-15  6:09 Yang Shi
2020-01-15 12:08 ` Li Xinhai
2020-01-15 17:27   ` Yang Shi
2020-01-16 15:52     ` Li Xinhai [this message]

Reply instructions:

You may reply publically 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=20200116235250155994144@gmail.com \
    --to=lixinhai.lxh@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=yang.shi@linux.alibaba.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

Linux-mm Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-mm/0 linux-mm/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-mm linux-mm/ https://lore.kernel.org/linux-mm \
		linux-mm@kvack.org
	public-inbox-index linux-mm

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kvack.linux-mm


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git