Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp5863675pxb; Thu, 27 Jan 2022 00:50:56 -0800 (PST) X-Google-Smtp-Source: ABdhPJzgzFXFDjJnIGH10mX1QDs6PDATm/jOtt+elb1/rSesIi8IVsFFzRBjzAsqiEqEmUM/UjSu X-Received: by 2002:a17:907:9810:: with SMTP id ji16mr2223109ejc.139.1643273456670; Thu, 27 Jan 2022 00:50:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643273456; cv=none; d=google.com; s=arc-20160816; b=nq+KMxj+AmTMzZZnT3EHmbitpe7PNJYAV6LAtl/Dp+i605saaUkvpS0/gnnuYYosuG EfS1JfUFjywcVCmkeYBEKSdlPWrYNJO09I/dmP20SQ3G68ShFF6coLb30DkpFEHMvI6K swtZ1bYFJGLafKgZ7kiJdo+/iQnlyBTqgYBaqFj3Gkg5NrMKtqnnOf4YDx/x9fUQstgN ZO/p8fcOnXpkvl7qOASPak5M1UIBN+gqutJaYsIuvlu8JmeKKjEP75rM4o0ylyZHATKR 1174zdRGbNwckmPWYoIjdgXUCiwRvwQM2iTN1Yrb4nDKb63WD9ZX9T/aYChbQZ5DswSF 5j3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=ezizBQJzev59fSxaPiCAfhX5lgLl/r7lnW/TtwPXhG8=; b=HjuvML92TiMrYZWP6m3xMWR/1MN2xhM8bl3jx9d3ClDLG4dvEsCajpm6yV0q4OsHqg 55jQBXZ56rZN49gIroPBaOkEUqa2b2wryI9uf7AwwVYeaOthB6C9mJ9uYvKxwFmWnNfR EalCIG6Pjg/EVwrJwFwQ/CWqpbeOE2qkZqApdfQsOT0PsXXH7BlkTpDfMuSQYtzHgG/d aVtAnr9QoG/9L4Zk8/ftvXdwiWVw+YkL6sdb8Z657OgRZgEAjCck0hsCinocz+AVxyO1 GnggI1gAN32fWjFuPXe3MyrOTaGNUvzrjzfLXKFiKT9t8V30HQ61cdX6Akm6gGjgEYjm TvpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=NlD2IckM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r17si1057733edx.126.2022.01.27.00.50.31; Thu, 27 Jan 2022 00:50:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=NlD2IckM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234324AbiA0BK6 (ORCPT + 99 others); Wed, 26 Jan 2022 20:10:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38156 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230465AbiA0BK6 (ORCPT ); Wed, 26 Jan 2022 20:10:58 -0500 Received: from mail-ed1-x52a.google.com (mail-ed1-x52a.google.com [IPv6:2a00:1450:4864:20::52a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 84EE3C06161C for ; Wed, 26 Jan 2022 17:10:57 -0800 (PST) Received: by mail-ed1-x52a.google.com with SMTP id m11so1437169edi.13 for ; Wed, 26 Jan 2022 17:10:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:reply-to:references:mime-version :content-disposition:in-reply-to:user-agent; bh=ezizBQJzev59fSxaPiCAfhX5lgLl/r7lnW/TtwPXhG8=; b=NlD2IckMmRI2RKARXlvPtGcR7GXp1Z4X/v8iPLvUwpDBgjkmfSNUmTv9LUSrAxfnmD M7jH6bQQCgoDicDTkvXPLGrojNTp1u9JdJUdo2IMMHO79VaBv00li0yfcjDp9x/oZp3a sPSFit5FvNS5FpX+HBeijVk0+JJYLwo4Kk5mPjXryrwD3Ft20pXZc2FGxka3n2YVh1K7 Qyg1ot/cVyipuEKyeuirJ5UwmcRynCAUaZpwBZhs63mXwNEzT1btPpNcoLSj4YaAfmvg SzLy/CsCihnVhJ9/IoK6Tt3AijNMavTN/sZUQ4lFUqXK7D/Svt6bx+JPi30uw9AyHiq/ IuYA== 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:reply-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=ezizBQJzev59fSxaPiCAfhX5lgLl/r7lnW/TtwPXhG8=; b=vdlWR7NrkbI3BXEf9WcrHLRwqFs9WrQpKZPFbB7T1RM0Lku8LeG/OxVarcWRT1ADMm +qwxfB4iie0Wbd3PU7AukO7la+Z02lVkP7kedhLVW9hNaCM8KV2inD6ZVDgz/hkFMXTS 0OqSDUyrShk5h2/OhnSGj+hOS1uKywsHK6v0vo3OJL4wPq7UEHADz9u5yF0eDUMkM/Jv XmhoRmOZLAxhVTX53s9CY/FpIm9IXYxjzOjmmTpMQB1EGAbAF6C2d1d1P5YjSX2kTi3W ZXsmU2m4dgz0xWtHkteKvrmnyWgYfgrOGv5Pv5c5E0irscA0IPQVPnbIi6vdKdj98k0A VwZg== X-Gm-Message-State: AOAM533/YeWj5UhG8aUI93hX38n1vmsYI2QFrcFQRNigUwqRLISdV0ze 8xQ5aaaVPTI+XExXN17Jpp4= X-Received: by 2002:aa7:dd02:: with SMTP id i2mr1514611edv.251.1643245856071; Wed, 26 Jan 2022 17:10:56 -0800 (PST) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id w18sm7777189edr.59.2022.01.26.17.10.55 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 26 Jan 2022 17:10:55 -0800 (PST) Date: Thu, 27 Jan 2022 01:10:54 +0000 From: Wei Yang To: Vlastimil Babka Cc: Wei Yang , Matthew Wilcox , Andrew Morton , peterz@infradead.org, will@kernel.org, linyunsheng@huawei.com, aarcange@redhat.com, feng.tang@intel.com, ebiederm@xmission.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm: remove offset check on page->compound_head and folio->lru Message-ID: <20220127011054.zlqtydxbhi4ioj5d@master> Reply-To: Wei Yang References: <20220107134059.flxr2hcd6ilb6vt7@master> <20220107160825.13c71fdd871d7d5611d116b9@linux-foundation.org> <20220108081340.3oi2z2rm3cbqozzt@master> <20220123013852.mm7eyn3z26v3hkc2@master> <93c48e68-2266-72ee-0763-65805b94c968@suse.cz> <20220124225531.26yyse52yo5x3fr5@master> <581f4247-83b1-df39-6724-af0565d0c7ea@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <581f4247-83b1-df39-6724-af0565d0c7ea@suse.cz> User-Agent: NeoMutt/20170113 (1.7.2) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 25, 2022 at 11:11:40AM +0100, Vlastimil Babka wrote: >On 1/24/22 23:55, Wei Yang wrote: >> On Mon, Jan 24, 2022 at 11:30:10AM +0100, Vlastimil Babka wrote: >>>On 1/23/22 02:38, Wei Yang wrote: >>>> On Sat, Jan 08, 2022 at 08:13:40AM +0000, Wei Yang wrote: >>>>>On Sat, Jan 08, 2022 at 12:49:53AM +0000, Matthew Wilcox wrote: >>>>>>On Fri, Jan 07, 2022 at 04:08:25PM -0800, Andrew Morton wrote: >>>>> >>>>>To me, if folio has the same layout of page, folio meets this requirement. I >>>>>still not catch the point why we need this check here. >>>>> >>>> >>>> Hi, Matthew >>>> >>>> Are you back from vocation? If you could give more insight on this check, I >>>> would be appreciated. >>> >>>I can offer my insight (which might be of course wrong). Ideally one day >>>page.lru will be gone and only folio will be used for LRU pages. Then there >>>won't be a FOLIO_MATCH(lru, lru); and FOLIO_MATCH(compound_head, lru); >>>won't appear to be redundant anymore. lru is list_head so two pointers and >> >> Thanks for your comment. >> >> I can't imagine the final result. If we would remove page.lru, we could remove >> FOLIO_MATCH(lru, lru) and add FOLIO_MATCH(compound_head, lru) at that moment? > >Yes, or we could forget to do it. Adding it right now is another option that >Matthew has chosen and I don't see a strong reason to change it. Can you >measure a kernel build speedup thanks to removing the now redundant check? > If we forget to do it, the compile would fail, right? Put it here for a future reason is not persuasive. >>>thus valid pointers are aligned in such a way they can't accidentaly set the >>>bit 0. >>> >> -- Wei Yang Help you, Help me