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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id E62DBC433F5 for ; Fri, 29 Apr 2022 11:36:15 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 437206B0071; Fri, 29 Apr 2022 07:36:15 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3E6CA6B0073; Fri, 29 Apr 2022 07:36:15 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2AE436B0074; Fri, 29 Apr 2022 07:36:15 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.27]) by kanga.kvack.org (Postfix) with ESMTP id 1D7BC6B0071 for ; Fri, 29 Apr 2022 07:36:15 -0400 (EDT) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id E61C421771 for ; Fri, 29 Apr 2022 11:36:14 +0000 (UTC) X-FDA: 79409713068.26.C35F4BB Received: from mail-pf1-f171.google.com (mail-pf1-f171.google.com [209.85.210.171]) by imf02.hostedemail.com (Postfix) with ESMTP id 44E0B8006F for ; Fri, 29 Apr 2022 11:36:10 +0000 (UTC) Received: by mail-pf1-f171.google.com with SMTP id x52so5128812pfu.11 for ; Fri, 29 Apr 2022 04:36:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20210112.gappssmtp.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=5qUXGCF9AGuwVC1iTJpuUcJbkoFNkd+P9LIidzVotos=; b=bfQr51xrs9FtI21KSefs0zZ1ihw1LAv6w7I3X1g8AnFPyonM8MdvuT2A9ngE8QFp+q O4z0y8eiB/q6xeJBpL5stCotC3j7A3WwVTHeTGKo/sR11C/8tNo7Qdf1OCoMRRlFTnp5 SOvWHTJQzb69dkNt5FbH/o9QP1lUttnqL/mhHW5AmBjLCB2Nb7kRW3GNNjsoZPGvcA7w 0A9xrhE8x1N3xi4lmnvhkg7jNxIYj6ugBTju4TR/+u40AnErvBONm4jMDAB3c8LyljrK g+OZUNlY9xU6Cvl5Ec9/ga37bUzn6qL20Thb0+MTRHJtRf111Ompu2WrLHqIVtSHNgP4 Gctw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=5qUXGCF9AGuwVC1iTJpuUcJbkoFNkd+P9LIidzVotos=; b=EiWESZGXDGBO9rafS+FuDJpPJOZHPZpH2W4mMg3TbkTWoUOBbFQApX7hGnXgC7NVk1 zUFVy8bWs1TdVtDWKZASuXoxjhoM0ldfaxkYuyA15n43VSOJvF/TX4MLryXXtOCj1olb j8xJul+TV3DD/qpHeLx1ZNrGlOktR065/nMBjG0Wu17Vuz1IlRkNmi2S4ZX0Eh8XxnsI YrqeG/PGQgtGEMkhc+07qsyKbKaBlFsUIwVDcNcgSZVnOhWNdldpxNyz1yp7lrvjPDWs rZtMKHJXnzkvk5ZCJU4oQFtJuGtVJkMthwwvXNKLZ1JeVNFeqY+77yjBrnvglQn8Wmg6 G7Cg== X-Gm-Message-State: AOAM530e+N+KMJ7Obbq4KMr3ksyc+c/b28ZPX7hfGAYj8jVu5nTJXbnP gdlNDDfhdLofrLDq+fN4eE3ISw== X-Google-Smtp-Source: ABdhPJyH5uWVKw0STd5Fcnd3XA9AY/TjWha8CcbSuTVN81N8D2DsNXSmgPcdLUKoobMlNXu73d/wNQ== X-Received: by 2002:a05:6a02:197:b0:382:a4b0:b9a8 with SMTP id bj23-20020a056a02019700b00382a4b0b9a8mr31689034pgb.325.1651232172519; Fri, 29 Apr 2022 04:36:12 -0700 (PDT) Received: from localhost ([139.177.225.239]) by smtp.gmail.com with ESMTPSA id g15-20020aa7818f000000b00505ce2e4640sm2794583pfi.100.2022.04.29.04.36.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Apr 2022 04:36:12 -0700 (PDT) Date: Fri, 29 Apr 2022 19:36:09 +0800 From: Muchun Song To: Miaohe Lin Cc: akpm@linux-foundation.org, mike.kravetz@oracle.com, naoya.horiguchi@nec.com, ying.huang@intel.com, hch@lst.de, dhowells@redhat.com, cl@linux.com, david@redhat.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 3/4] mm/migration: return errno when isolate_huge_page failed Message-ID: References: <20220425132723.34824-1-linmiaohe@huawei.com> <20220425132723.34824-4-linmiaohe@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220425132723.34824-4-linmiaohe@huawei.com> X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 44E0B8006F X-Stat-Signature: nrsbsrxu8efzu4jxtjp3t418sfqbsewx X-Rspam-User: Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=bfQr51xr; spf=pass (imf02.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.210.171 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com; dmarc=pass (policy=none) header.from=bytedance.com X-HE-Tag: 1651232170-654638 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, Apr 25, 2022 at 09:27:22PM +0800, Miaohe Lin wrote: > We might fail to isolate huge page due to e.g. the page is under migration > which cleared HPageMigratable. So we should return -EBUSY in this case > rather than always return 1 which could confuse the user. Also we make > the prototype of isolate_huge_page consistent with isolate_lru_page to > improve the readability. > > Fixes: e8db67eb0ded ("mm: migrate: move_pages() supports thp migration") > Suggested-by: Huang Ying > Signed-off-by: Miaohe Lin > --- > include/linux/hugetlb.h | 6 +++--- > mm/gup.c | 2 +- > mm/hugetlb.c | 11 +++++------ > mm/memory-failure.c | 2 +- > mm/mempolicy.c | 2 +- > mm/migrate.c | 5 +++-- > 6 files changed, 14 insertions(+), 14 deletions(-) > > diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h > index 04f0186b089b..306d6ef3fa22 100644 > --- a/include/linux/hugetlb.h > +++ b/include/linux/hugetlb.h > @@ -170,7 +170,7 @@ bool hugetlb_reserve_pages(struct inode *inode, long from, long to, > vm_flags_t vm_flags); > long hugetlb_unreserve_pages(struct inode *inode, long start, long end, > long freed); > -bool isolate_huge_page(struct page *page, struct list_head *list); > +int isolate_huge_page(struct page *page, struct list_head *list); > int get_hwpoison_huge_page(struct page *page, bool *hugetlb); > int get_huge_page_for_hwpoison(unsigned long pfn, int flags); > void putback_active_hugepage(struct page *page); > @@ -376,9 +376,9 @@ static inline pte_t *huge_pte_offset(struct mm_struct *mm, unsigned long addr, > return NULL; > } > > -static inline bool isolate_huge_page(struct page *page, struct list_head *list) > +static inline int isolate_huge_page(struct page *page, struct list_head *list) Since you already touched all the call sites, how about renaming this to hugetlb_isolate()? I've always felt that huge_page is not a straightforward and clear name since we also have another type of huge page (THP). I think hugetlb is more specific. Thanks.