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 2FA91C33CA1 for ; Mon, 20 Jan 2020 09:20:14 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id EAD7D20684 for ; Mon, 20 Jan 2020 09:20:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EAD7D20684 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 843BD6B060E; Mon, 20 Jan 2020 04:20:13 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 7CCA06B060F; Mon, 20 Jan 2020 04:20:13 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 694046B0610; Mon, 20 Jan 2020 04:20:13 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0094.hostedemail.com [216.40.44.94]) by kanga.kvack.org (Postfix) with ESMTP id 4AE536B060E for ; Mon, 20 Jan 2020 04:20:13 -0500 (EST) Received: from smtpin24.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with SMTP id D97B58248047 for ; Mon, 20 Jan 2020 09:20:12 +0000 (UTC) X-FDA: 76397466264.24.walk17_1c05f02c1157 X-HE-Tag: walk17_1c05f02c1157 X-Filterd-Recvd-Size: 3107 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf48.hostedemail.com (Postfix) with ESMTP for ; Mon, 20 Jan 2020 09:20:11 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id DCC1D30E; Mon, 20 Jan 2020 01:20:10 -0800 (PST) Received: from [10.162.16.78] (p8cg001049571a15.blr.arm.com [10.162.16.78]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 71E903F68E; Mon, 20 Jan 2020 01:20:09 -0800 (PST) Subject: Re: [PATCH v4] mm/mempolicy,hugetlb: Checking hstate for hugetlbfs page in vma_migratable To: Michal Hocko , Li Xinhai Cc: "linux-mm@kvack.org" , akpm , Mike Kravetz References: <1579147885-23511-1-git-send-email-lixinhai.lxh@gmail.com> <20200116095614.GO19428@dhcp22.suse.cz> <20200116215032206994102@gmail.com> <20200116151803.GV19428@dhcp22.suse.cz> From: Anshuman Khandual Message-ID: Date: Mon, 20 Jan 2020 14:51:31 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20200116151803.GV19428@dhcp22.suse.cz> Content-Type: text/plain; charset=utf-8 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 01/16/2020 08:48 PM, Michal Hocko wrote: > On Thu 16-01-20 21:50:34, Li Xinhai wrote: >> On 2020-01-16=C2=A0at 17:56=C2=A0Michal Hocko=C2=A0wrote: >>> On Thu 16-01-20 04:11:25, Li Xinhai wrote: >>>> Checking hstate at early phase when isolating page, instead of durin= g >>>> 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 change = 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 ca= lled >> from=C2=A0unmap_and_move_huge_page(), after isolating page has >> completed. >> This patch checks hstate from vma_migratable() and avoids isolating pa= ges >> which are not supported. >=20 > This still explains what but not why this is relevant. If by isolating > pages you mean isolate_lru_page then this really a noop for hugetlb > pages. Or do I still misread your changelog? unmap_and_move_hugepage() aborts migrating a HugeTLB page (from the list) if it's corresponding hstate does not support migration. IIUC the current proposal will enable early bail out and prevent migration via migrate_pag= es() at a much higher level like mbind() and other system calls if correspondi= ng VMA is HugeTLB but it's hstate lacks migration support. This should proba= bly save some cycles for HugeTLB VMAs.