Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp12390865rwl; Tue, 3 Jan 2023 13:42:12 -0800 (PST) X-Google-Smtp-Source: AMrXdXvSdKFVCLAMNhrvzIc/iYJqgO0cah8kDu5DWLgl5IllnmS96fzwliRq0KDgR8ZXb85N0hZC X-Received: by 2002:a17:906:2896:b0:7ad:b286:2184 with SMTP id o22-20020a170906289600b007adb2862184mr40406908ejd.71.1672782132281; Tue, 03 Jan 2023 13:42:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672782132; cv=none; d=google.com; s=arc-20160816; b=X+NaGGQu71UQjM8KbeSLy6yNygb8/oknW9fMIHXsc0kiDLJUKjXDt6X6RLvC1CCxNM 1GHItIfrcP7g+Zg7eWtolq6xEt51yMGbvGPPJU3I3xVjmaUTYd+w3YiBxLgfxFn4rInI 2jQ2sFoXwLnrkknRbcPceqrrplu4LeTXrmbiB91UvtE3VS2E3bqhwubnRE2WiSDPAScg +jq4G3UwdnyfHPopaKSXIFDsu449yB0Kf5CZFrXhqrinbXvEbR+1J/wveydDHasYeH00 gThaSTjMm3diLvreUICBccu4XHrRw4ysEK15fzMMGARJEWlxyvkvuBfRXUDYUPzurpWM b1ng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=lQIrLUPIl+i/y2McQ1KqovnwZ37cPRNSnM0HrSIfVis=; b=vopHMWrmd8ROHqQH4VLwAM5tCgr43TAyI6Kw47u/dxqD1Iw42yU7dDAeLp3Nb9/I/t h0hvoV9fr5FuVLBYe5RPkR52md5GH7QK2gyRsXAbE/+AqhsDohvHSo1dGR+A10NCbdaQ WaH6MdyTTVsv0pQ612AzZhYQYUnvTuvuvacK1HlEJUF6UF5vyI2zMcR2ZjHFDamwEk7p 5E2ZngGkt7jWhXYIRH6FNmyk3Gz8WB90tHnscu6BbQvhW5iQNTxgFCgI0J5zuONde+GV 95QW3yvlPnMS3SfF/VDxyiXne5aMExh3msIbtYgJ5YLXEKD1yJzvMmCMtqutoR/if4fD Xsew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=U5Yd3TP8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ji20-20020a170907981400b007adfe2889efsi28988986ejc.607.2023.01.03.13.41.57; Tue, 03 Jan 2023 13:42:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=U5Yd3TP8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234505AbjACVAH (ORCPT + 59 others); Tue, 3 Jan 2023 16:00:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230215AbjACVAF (ORCPT ); Tue, 3 Jan 2023 16:00:05 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2AA38EE33 for ; Tue, 3 Jan 2023 13:00:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=lQIrLUPIl+i/y2McQ1KqovnwZ37cPRNSnM0HrSIfVis=; b=U5Yd3TP8tnDWS6O60ptT4qa7jt RBmNen4FN/NtclUgVvGiIGuxpwRXoVrRtBWIXk6Kz+9PnIBEq/LjhjQCR8WNFd05sR8P0kE++2lnC +OMZS9ptA/MakBJ+CgZs0v9O7oIeHFgdXDuqUFU8UPxnPpE2ZmOKeuSc474x00KOj4b4refXOIYqr 3p0RLQjw/wztNADrYv+gAl3+1fcOK0cBniioz1Ab/Kj+P5pXzb0R1Kdv3396Q60d0+/J9e4y7wa9u WaYNRmJRiQ2Ax9rLQpRQfmWshtiUFfLrqePpUupI3yrrEjIg6iB8DUXiiARn9hMRnTxyxIZp66CLB ElF5w8WQ==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1pCoOK-00EPEc-NI; Tue, 03 Jan 2023 21:00:12 +0000 Date: Tue, 3 Jan 2023 21:00:12 +0000 From: Matthew Wilcox To: Sidhartha Kumar Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, akpm@linux-foundation.org, songmuchun@bytedance.com, mike.kravetz@oracle.com, tsahu@linux.ibm.com, jhubbard@nvidia.com Subject: Re: [PATCH mm-unstable 3/8] mm/hugetlb: convert dequeue_hugetlb_page_node functions to folios Message-ID: References: <20230103191340.116536-1-sidhartha.kumar@oracle.com> <20230103191340.116536-4-sidhartha.kumar@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230103191340.116536-4-sidhartha.kumar@oracle.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 03, 2023 at 01:13:35PM -0600, Sidhartha Kumar wrote: > +static struct folio *dequeue_hugetlb_folio_node_exact(struct hstate *h, > + int nid) > { > struct page *page; > + struct folio *folio; > bool pin = !!(current->flags & PF_MEMALLOC_PIN); > > lockdep_assert_held(&hugetlb_lock); > list_for_each_entry(page, &h->hugepage_freelists[nid], lru) { > - if (pin && !is_longterm_pinnable_page(page)) > + folio = page_folio(page); I'd argue that you can pull folios directly off the hugepage_freelists. Since they're attached through the 'lru', you know they're not tail pages, because lru.prev aliases with compound_head. The rest looks good.