Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp3712516ybl; Mon, 27 Jan 2020 09:01:52 -0800 (PST) X-Google-Smtp-Source: APXvYqw9UcXrSs2dhps5TgvvhzT2nwNSlE+fyDGP+U1cR2E3PwAFwmL2Edna9KmCjOs8wzzC+0a3 X-Received: by 2002:a9d:7083:: with SMTP id l3mr5801740otj.193.1580144512026; Mon, 27 Jan 2020 09:01:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580144512; cv=none; d=google.com; s=arc-20160816; b=j7RLDiuuW7KqEwEq70FhT4eN8SEJ913EHSgS+Pb/zhzZI70J9o3l5gLP/RnSMjfcbJ tCPyZVekvsZ8A0yIXcJ7kaAjWEDt0hGAY/eULZkClyWEI/PvqFNpC2UHjLi69I8zkujC bHzLCO7ZujPDM7H/XNnOG/sypYiyVzUPsDc6ixmcJsXS2aSkkIsJ+d+SBEehNgRQdjPQ 4rgIx2idATXNsNxHhoa0HROMTpGK+y6Wk9veC5ETJbmj1cZ2pdJ0BPSBJSyFTHxl3GTX 8SNIhQadXllVe9hBMuMEHyrHQnFYeajr7ZtQcVVMFatFLEcntMskie5QWSXon4P6IqlD ToqA== 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=+FJSrLfUmgXuCDVTrxOEqo+J+2r+fZYIOQZKAKOKwko=; b=C9Sn5fdNttdeFzRRoU5PCTIOFZRBQbXK7c2sCiEIDVCmU+XuW0u2YTE60K6yHYrIeU sM9bKtiTsCblj9CC3aFav0+cicirLktF5RFgG15s5SyqANn8DNenF87jnbsE0kPtTcVj siuSZxpC5aB9gENgIT7u97kTZKEUoK1uxNpZgZkF0XQhC/U0qt25zUAE6KPFxHvZ+prR wigMYVTOyG8AnlTOdogRCuSv8XBDLVN610K7Vx9AFh/jKC8m8K/eWFlMsFpfVBW1y7RS 2fgUxjMV37I9gv3ZFnN13A+CHQiV9fX2p7ApsO+hkxQLsHtPImQQOLECCBy4Aj1dY4Bz S7WA== 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 h28si8673278otg.63.2020.01.27.09.01.38; Mon, 27 Jan 2020 09:01:52 -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 S1726145AbgA0RA2 (ORCPT + 99 others); Mon, 27 Jan 2020 12:00:28 -0500 Received: from out30-42.freemail.mail.aliyun.com ([115.124.30.42]:59862 "EHLO out30-42.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725828AbgA0RA2 (ORCPT ); Mon, 27 Jan 2020 12:00:28 -0500 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R791e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04394;MF=yang.shi@linux.alibaba.com;NM=1;PH=DS;RN=4;SR=0;TI=SMTPD_---0Tocs7WW_1580144404; Received: from US-143344MP.local(mailfrom:yang.shi@linux.alibaba.com fp:SMTPD_---0Tocs7WW_1580144404) by smtp.aliyun-inc.com(127.0.0.1); Tue, 28 Jan 2020 01:00:06 +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> <2a9ad6d6-af98-987a-0878-6058702db912@linux.alibaba.com> <20200116235250155994144@gmail.com> From: Yang Shi Message-ID: <70b6680c-7d3c-e04e-9e12-aab69a906d19@linux.alibaba.com> Date: Mon, 27 Jan 2020 08:59:59 -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: <20200116235250155994144@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/16/20 7:52 AM, Li Xinhai wrote: > 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 >>> 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. Hi Andrew, Would you like to take this patch for v5.6 or v5.7? It looks Xinhai agrees with my point. Thanks, Yang >>>> --- >>>> 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 >>>> >>>> > >