Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp6743262ybl; Wed, 15 Jan 2020 09:29:31 -0800 (PST) X-Google-Smtp-Source: APXvYqyNuaLUp1A995Ec77VfBAqVRUcuS7lYSx1kuUYGP57JL6zqr+MFFXcDNqdxJbKjUa2Tx9D0 X-Received: by 2002:aca:7244:: with SMTP id p65mr727467oic.50.1579109371335; Wed, 15 Jan 2020 09:29:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579109371; cv=none; d=google.com; s=arc-20160816; b=wIDd5uauR0rYGkJ0O8oykqi0/RFWCLYi1skz9z3VDlOReA5wQa1fzoCQi4n5Lc4VV+ /dKs8eXv9vDV4r8ruhjVoH834axAfnlTPf2+ij8vIRYtxt+QyfBZyl6mHnZe6mLjTgVz hRAh2ZYY2+3/rAfDYHh7bE7dFXUqxIBGLo/88ULX7jyt9abMnJPEM0O6cjkzhWjkiZJK s703T1nZtg+ZVU1EIPIu8s/n2leYsiZwIZpi0uVB0es1cmlmhe6FAxZh7snWqzV0oyxv 4reC2SXsA9zYZa2aovZlRdaWJ+KdXDq4k2kJYtgp0CCQUBqA3BG9tZsUuvtU1Cq9zpaY fp3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=W2DpCS8gSAXztDyfCt2U86L/VOMcpqCr02n2PMFvptk=; b=VMZKuxbsSkFfaGsGQBKgjLsTpOORg7XDpPqHEXfiiYzQDypx8/IfR8XamiIQNFvOI7 ujI8iOIZy/e0+oydqE/a9xMAj2OTGTSzTFXc/Y8FHBYHJ92fIMe83jsG+hU04Cuyh+JE dk0/ZvSl0RawPEO/u6bBAzmNnXUHQZF70ZmFYffy9aiYU21EzgPG/XAWqjs3Y/EOSntC zuFDDq/GTvV06VUg2h6CmDxlVBFRJsKIJjSIsLh8xpsLB9l1URudaDIcIZ9TWJc2nJgj Z8BW2nrFaIfvvCXymp7gVhceeMN5Cu6g2TO8xunnyMVmMP1fhx/49F3qvWhIb/KIYHZp onCQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k19si8613318otb.118.2020.01.15.09.29.18; Wed, 15 Jan 2020 09:29:31 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729028AbgAOR1N (ORCPT + 99 others); Wed, 15 Jan 2020 12:27:13 -0500 Received: from out30-132.freemail.mail.aliyun.com ([115.124.30.132]:37916 "EHLO out30-132.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728904AbgAOR1N (ORCPT ); Wed, 15 Jan 2020 12:27:13 -0500 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-Transfer-Encoding: 8bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > 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. > >> --- >> 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 >> > >