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 B6F90C2D0DB for ; Mon, 20 Jan 2020 16:05:05 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 828092073D for ; Mon, 20 Jan 2020 16:05:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 828092073D 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 05C096B067E; Mon, 20 Jan 2020 11:05:05 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 00C886B067F; Mon, 20 Jan 2020 11:05:04 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E63B76B0680; Mon, 20 Jan 2020 11:05:04 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0045.hostedemail.com [216.40.44.45]) by kanga.kvack.org (Postfix) with ESMTP id CBE7F6B067E for ; Mon, 20 Jan 2020 11:05:04 -0500 (EST) Received: from smtpin29.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with SMTP id 7E4AC45C1 for ; Mon, 20 Jan 2020 16:05:04 +0000 (UTC) X-FDA: 76398486528.29.shoes54_2c3f94a3d0727 X-HE-Tag: shoes54_2c3f94a3d0727 X-Filterd-Recvd-Size: 4710 Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by imf25.hostedemail.com (Postfix) with ESMTP for ; Mon, 20 Jan 2020 16:05:03 +0000 (UTC) Received: by mail-wr1-f65.google.com with SMTP id y17so1597wrh.5 for ; Mon, 20 Jan 2020 08:05:03 -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:in-reply-to:user-agent; bh=pchtgtPl7QsNhnLKqQnFHxUQcOqFwM/PSkX6RSgnDKM=; b=UkybqKSReG0S3M5YrU2tW20KphYe/LA5mKEOFh93ROO1GuGO7sX6onfNBPjIwnSOTq VFKI/ICIAoplk8uS7uzhwY64CsnmlskmuQDS+0Vd1ZCPkNELxxOPavxijur9l6bECS7v MjidvMxRacmqZgQpsR9JgbDptKZKJ813edyBW8DWmtqmIVGd2EbJ0AIh9ajod6DviIr1 C04N/Nt74S2Bv4G7DURD76iRs9EwnRSw+jisWKpi0J3cxAWfmDJFSdDzw5yL1rt1736w vN7sJXOZznfejWvItC5NiBjTHBfh+GYIO3Yckbq+NTQU/qAsa694bhqHcKSDbHziQ9Ej ugbA== X-Gm-Message-State: APjAAAWxnQdjLtyq9DCrxurRv0J9QYMb5qKJxLsHXzpHcATMaey3MsDK fSgws7lJtwtgeruiCkAjAzcX+XIS X-Google-Smtp-Source: APXvYqyMf+pGJvZD7BFKyy1zUboNw4H+hWUL04RoWn8vOUeeecst1TBK1XWG1ZIz+dYtdajL5OPYjw== X-Received: by 2002:a05:6000:11c3:: with SMTP id i3mr228393wrx.244.1579536302938; Mon, 20 Jan 2020 08:05:02 -0800 (PST) Received: from localhost (prg-ext-pat.suse.com. [213.151.95.130]) by smtp.gmail.com with ESMTPSA id d8sm49235291wre.13.2020.01.20.08.05.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Jan 2020 08:05:01 -0800 (PST) Date: Mon, 20 Jan 2020 17:05:00 +0100 From: Michal Hocko To: Li Xinhai Cc: "anshuman.khandual" , n-horiguchi , "linux-mm@kvack.org" , akpm , torvalds , "linux-kernel@vger.kernel.org" , Mike Kravetz Subject: Re: [PATCH v4] mm/mempolicy,hugetlb: Checking hstate for hugetlbfs page in vma_migratable Message-ID: <20200120160500.GM18451@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> <20200116233817972969139@gmail.com> <20200117111629898234212@gmail.com> <20200118111121432688303@gmail.com> <20200120101202.GU18451@dhcp22.suse.cz> <20200120233723466954346@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200120233723466954346@gmail.com> User-Agent: Mutt/1.12.2 (2019-09-21) 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 23:37:25, Li Xinhai wrote: [...] > Changelog is updated as below, thanks for comments: > --- > mm/mempolicy: Checking hugepage migration is supported by arch in vma_migratable > > vma_migratable() is called to check if pages in vma can be migrated > before go ahead to further actions. Currently it is used in below code > path: > - task_numa_work > - mbind > - move_pages > > For hugetlb mapping, whether vma is migratable or not is determined by: > - CONFIG_ARCH_ENABLE_HUGEPAGE_MIGRATION > - arch_hugetlb_migration_supported > > Issue: current code only checks for CONFIG_ARCH_ENABLE_HUGEPAGE_MIGRATION, > which express less accurate semantics of vma_migratable(). (note that > current code in vma_migratable don't cause failure or bug because > unmap_and_move_huge_page() will catch unsupported hugepage and handle it > properly) > > This patch checks the two factors for impoveing code logic and > robustness. It will enable early bail out of hugepage migration procedure, > but because currently all architecture supporting hugepage migration is able > to support all page size, we would not see performance gain with this patch > applied. This looks definitely better than the original one. I hope it is more clear to you what I meant by a better description for the justification. I would just add that the no code should use CONFIG_ARCH_ENABLE_HUGEPAGE_MIGRATION directly and use arch_hugetlb_migration_supported instead. This will be the case after this patch. Please keep in mind that changelogs are really important and growing in importance as the code gets more complicated over time. It is much more easier to see what the patch does because reading diffs and the code is easy but the lack of motivation is what people usually fighting with. -- Michal Hocko SUSE Labs