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=-2.5 required=3.0 tests=MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no 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 50968C33CB1 for ; Wed, 15 Jan 2020 09:31:52 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id EB6C6207FF for ; Wed, 15 Jan 2020 09:31:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EB6C6207FF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 584438E000B; Wed, 15 Jan 2020 04:31:51 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 536DA8E0003; Wed, 15 Jan 2020 04:31:51 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 44B648E000B; Wed, 15 Jan 2020 04:31:51 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0214.hostedemail.com [216.40.44.214]) by kanga.kvack.org (Postfix) with ESMTP id 2C89F8E0003 for ; Wed, 15 Jan 2020 04:31:51 -0500 (EST) Received: from smtpin03.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with SMTP id D38F7A2A4 for ; Wed, 15 Jan 2020 09:31:50 +0000 (UTC) X-FDA: 76379351580.03.woman90_6762cde644804 X-HE-Tag: woman90_6762cde644804 X-Filterd-Recvd-Size: 3854 Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) by imf03.hostedemail.com (Postfix) with ESMTP for ; Wed, 15 Jan 2020 09:31:50 +0000 (UTC) Received: by mail-wr1-f66.google.com with SMTP id t2so15023492wrr.1 for ; Wed, 15 Jan 2020 01:31:50 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=KFwdfTMsDL5KRuMi6j2mCJzqDUj8R/NuiqcnlYyoX7I=; b=qoUvNd8QZWjh62TJh6GWkmm3wksrGIptu9Irdd0iNO4vLazPldDVgDOeiIX22VtFqZ qpY6cdZK9uJVGTffuCWSFLDQ+l+uVX1I51zEqYuqpEMRKfU/wqtwFSQD7d1IBOAAHKva ekD/z7niUlu6jVWpNw5oaJ8mZxAWHAM03EEW6l673pVUtLqZNCAL6jTKQm2yQ0CGx3wG Livfj+7X3gLNrbSjMHmQldPztALmqvrgIxMETQdxAepyWAdhs/5AFGxk/6Tj72H/ljst 8FhEzAzJYMG6mDL1740Uk2lh2fVwRts9cWr8yh91LoXjvOzNnF3MzBA+7u7BI3XpMtGM 096Q== X-Gm-Message-State: APjAAAXmEr+BB9JMlCgGl7nclUj6DlvAfvBtXUh9Z85GsGhqtnNMuDl5 s6bYWRHief/BDHfFuCfoCEQ= X-Google-Smtp-Source: APXvYqzd3rL5o6ZIqbCvIbKCzwf9wjEaH8jGlMQNv9UJJiCmX57EhArNrOUOcU9WXK94L+VG7EYP6Q== X-Received: by 2002:adf:df03:: with SMTP id y3mr32367576wrl.260.1579080709469; Wed, 15 Jan 2020 01:31:49 -0800 (PST) Received: from localhost (prg-ext-pat.suse.com. [213.151.95.130]) by smtp.gmail.com with ESMTPSA id 16sm21957260wmi.0.2020.01.15.01.31.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jan 2020 01:31:48 -0800 (PST) Date: Wed, 15 Jan 2020 10:31:48 +0100 From: Michal Hocko To: Li Xinhai Cc: "linux-mm@kvack.org" , akpm , "kirill.shutemov" , Mike Kravetz Subject: Re: [PATCH v4] mm/page_vma_mapped.c: Explicitly compare pfn for normal, hugetlbfs and THP page Message-ID: <20200115093148.GZ19428@dhcp22.suse.cz> References: <1578737885-8890-1-git-send-email-lixinhai.lxh@gmail.com> <20200114092545.GF19428@dhcp22.suse.cz> <202001142147485028116@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <202001142147485028116@gmail.com> User-Agent: Mutt/1.12.2 (2019-09-21) 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 Tue 14-01-20 21:47:51, Li Xinhai wrote: > On 2020-01-14=A0at 17:25=A0Michal Hocko=A0wrote: > >On Sat 11-01-20 10:18:05, Li Xinhai wrote: > >> When check_pte, pfn of normal, hugetlbfs and THP page need be compar= ed. > >> The current implementation apply comparison as > >> - normal 4K page: page_pfn <=3D pfn < page_pfn + 1 > >> - hugetlbfs page:=A0 page_pfn <=3D pfn < page_pfn + HPAGE_PMD_NR > >> - THP page: page_pfn <=3D pfn < page_pfn + HPAGE_PMD_NR > >> in pfn_in_hpage. For hugetlbfs page, it should be > >> page_pfn =3D=3D pfn > >> > >> Now, change pfn_in_hpage to pfn_is_match to highlight that compariso= n > >> is not only for THP and explicitly compare for these cases. > > > >Why is this important to do. I have asked and Mike had the same feelin= g > >that the patch is missing any real justification. Why do we need this > >change? It is great that you have dropped VM_BUG_ON btw. > >=20 > I think it is important to make the code clear, as said, comparing huge= tlbfs page > in range=A0page_pfn <=3D pfn < page_pfn + HPAGE_PMD_NR is confusion. I am sorry but I do not really see a big confusion here. It is probably a matter of taste. If others consider this an improvement then I will not stand in the way but I consider the justification insuficient for merging. --=20 Michal Hocko SUSE Labs