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.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, 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 23271C2D0DB for ; Mon, 20 Jan 2020 11:32:04 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id E641920882 for ; Mon, 20 Jan 2020 11:32:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E641920882 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 8089C6B063A; Mon, 20 Jan 2020 06:32:03 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 7B9626B063B; Mon, 20 Jan 2020 06:32:03 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6CE566B063C; Mon, 20 Jan 2020 06:32:03 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0142.hostedemail.com [216.40.44.142]) by kanga.kvack.org (Postfix) with ESMTP id 53E986B063A for ; Mon, 20 Jan 2020 06:32:03 -0500 (EST) Received: from smtpin11.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with SMTP id 05AEC181AC9CB for ; Mon, 20 Jan 2020 11:32:03 +0000 (UTC) X-FDA: 76397798526.11.boot72_8641ca1b24d46 X-HE-Tag: boot72_8641ca1b24d46 X-Filterd-Recvd-Size: 3271 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf12.hostedemail.com (Postfix) with ESMTP for ; Mon, 20 Jan 2020 11:32:02 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 201FAABB3; Mon, 20 Jan 2020 11:32:01 +0000 (UTC) Date: Mon, 20 Jan 2020 12:32:00 +0100 From: Michal Hocko To: Anshuman Khandual Cc: Li Xinhai , "linux-mm@kvack.org" , akpm , Mike Kravetz Subject: Re: [PATCH v4] mm/mempolicy,hugetlb: Checking hstate for hugetlbfs page in vma_migratable Message-ID: <20200120113200.GZ18451@dhcp22.suse.cz> References: <1579147885-23511-1-git-send-email-lixinhai.lxh@gmail.com> <20200116095614.GO19428@dhcp22.suse.cz> <20200116215032206994102@gmail.com> <20200116151803.GV19428@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: 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 Mon 20-01-20 14:51:31, Anshuman Khandual wrote: >=20 >=20 > On 01/16/2020 08:48 PM, Michal Hocko wrote: > > On Thu 16-01-20 21:50:34, Li Xinhai wrote: > >> On 2020-01-16=A0at 17:56=A0Michal Hocko=A0wrote: > >>> On Thu 16-01-20 04:11:25, Li Xinhai wrote: > >>>> Checking hstate at early phase when isolating page, instead of dur= ing > >>>> unmap and move phase, to avoid useless isolation. > >>> > >>> Could you be more specific what you mean by isolation and why does = it > >>> matter? The patch description should really explain _why_ the chang= e is > >>> needed or desirable.=20 > >> > >> The changelog can be improved: > >> > >> vma_migratable() is called to check if pages in vma can be migrated > >> before go ahead to isolate, unmap and move pages. For hugetlb pages, > >> hugepage_migration_supported(struct hstate *h) is one factor which > >> decide if migration is supported. In current code, this function is = called > >> from=A0unmap_and_move_huge_page(), after isolating page has > >> completed. > >> This patch checks hstate from vma_migratable() and avoids isolating = pages > >> which are not supported. > >=20 > > This still explains what but not why this is relevant. If by isolatin= g > > pages you mean isolate_lru_page then this really a noop for hugetlb > > pages. Or do I still misread your changelog? >=20 > unmap_and_move_hugepage() aborts migrating a HugeTLB page (from the lis= t) > if it's corresponding hstate does not support migration. But all architectures support all hugeltb sizes unless I am missing something. If there is some which doesn't then the changelog should mention that. I have already asked for runtime effects with no data provided. Just to make it clear. I am not objecting to the patch itself. I am objecting to the very vague justification. The changelog doesn't explain _why_ do we need to change this. Is it a bug, non-optimal code, pure code clean up for a more robust code? --=20 Michal Hocko SUSE Labs