From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, UNPARSEABLE_RELAY,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EB7E9C32771 for ; Wed, 15 Jan 2020 17:27:19 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 93F752084D for ; Wed, 15 Jan 2020 17:27:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 93F752084D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 2BFBD8E0007; Wed, 15 Jan 2020 12:27:19 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 271778E0005; Wed, 15 Jan 2020 12:27:19 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 15F6A8E0007; Wed, 15 Jan 2020 12:27:19 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0063.hostedemail.com [216.40.44.63]) by kanga.kvack.org (Postfix) with ESMTP id F2D258E0005 for ; Wed, 15 Jan 2020 12:27:18 -0500 (EST) Received: from smtpin08.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with SMTP id A1863180AD806 for ; Wed, 15 Jan 2020 17:27:18 +0000 (UTC) X-FDA: 76380549756.08.tree06_2294bd07ca560 X-HE-Tag: tree06_2294bd07ca560 X-Filterd-Recvd-Size: 2825 Received: from out30-42.freemail.mail.aliyun.com (out30-42.freemail.mail.aliyun.com [115.124.30.42]) by imf03.hostedemail.com (Postfix) with ESMTP for ; Wed, 15 Jan 2020 17:27:17 +0000 (UTC) X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R381e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01f04452;MF=yang.shi@linux.alibaba.com;NM=1;PH=DS;RN=4;SR=0;TI=SMTPD_---0TnpIWCU_1579109229; Received: from US-143344MP.local(mailfrom:yang.shi@linux.alibaba.com fp:SMTPD_---0TnpIWCU_1579109229) by smtp.aliyun-inc.com(127.0.0.1); Thu, 16 Jan 2020 01:27:11 +0800 Subject: Re: [PATCH] mm: mempolicy: use VM_BUG_ON_VMA in queue_pages_test_walk() To: Li Xinhai , akpm Cc: "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" References: <1579068565-110432-1-git-send-email-yang.shi@linux.alibaba.com> <2020011520081970082765@gmail.com> From: Yang Shi Message-ID: <2a9ad6d6-af98-987a-0878-6058702db912@linux.alibaba.com> Date: Wed, 15 Jan 2020 09:27:07 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <2020011520081970082765@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 1/15/20 4:08 AM, Li Xinhai wrote: > On 2020-01-15=C2=A0at 14:09=C2=A0Yang Shi=C2=A0wrote: >> 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 > The .test_walk() is to be called from pagewalk with the rule that 'star= t' > and 'end' must within range of vma, in case the rule is broke, we detec= t > 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=20 the VMA range information to ease debugging? And, VM_BUG_ON is already=20 used in the code, I'm supposed the users may prefer more debug=20 information dumped for debug kernel. > >> --- >> 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 sta= rt, unsigned long end, >> unsigned long flags =3D 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 =3D vma; >> -- >> 1.8.3.1 >> > >