Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp354186pxb; Thu, 17 Feb 2022 05:43:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJx1d111gWqKQeL5zBojd5iBkcwOjMThctT7vDpkGGoPymFxhiZJAM5op9eZ+oE2bmBfgaRV X-Received: by 2002:a17:906:360a:b0:6b9:1f8:9cdd with SMTP id q10-20020a170906360a00b006b901f89cddmr2421132ejb.461.1645105384987; Thu, 17 Feb 2022 05:43:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645105384; cv=none; d=google.com; s=arc-20160816; b=nMCjDQjUR+kS/4m0aXZaaO6dtXSLEbu3IA/tsA+WY92lU1LSr+ifE6+X45s9x2XcDU o/8txzo7plOciN7ex5ot5StgT8sTjNTrQnJRdiolstQ72Fg2CzQy9An4iVLwO3w+GRrl IbbE3FoHJKscKpw8KNi04XUGbT91jUneUgSoOz/UEOc/UL2K111Y5jItYxdxIcIpgcro SvEaM37sI8AFAqLZwgoo7aqbVqVpFi7Qf1OJj7br6uE/Wg41V0nNb2Y3ibEFQkDz/yz3 ePBsbENrtqgk8x6DtW+yJRDOk/CWbjmsAqPpMOIuDYYDcHjSAj4taOcAuQ957qtfSKCF 5hSQ== 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=32dF3wm+g52NnE8DQB91PZHPpwomq5mRNnLyxvWUNLQ=; b=zNwR8xyAfzszMKs7V1KcNYw82g+YfsrMtSwQfMGmpqUuYt/DMyvnK5nuiMGT3tF/31 0vWTuTMO1uUJk9B6HUFVK3j/yhf6qnZaSmoLvYHY0sErgv3RFyBumCyqgeDPSbxVaR9D wXO75MfF97WxC2Q4IPqfrAx3IVCjtOCMZQGkaHyvO7YCbJyYvGFnqz26+V8vRik9KIS2 cyGfgv7VWjFCglTbRoRgxl+gZ0LTnFvkzCa7z50O5ukCN8MlgrvySTf5tTIqLrTzO9Fr QEjY8rG/1J8s23aYTgF7aNijTTlUmw2rBgFiBNfVjqpm/zahstQ40QNDojO4g4ZvC77q w/fQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=JbKRy81V; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n12si4727873edx.380.2022.02.17.05.42.41; Thu, 17 Feb 2022 05:43:04 -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=@gmail.com header.s=20210112 header.b=JbKRy81V; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229766AbiBQAeb (ORCPT + 99 others); Wed, 16 Feb 2022 19:34:31 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:43844 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229501AbiBQAea (ORCPT ); Wed, 16 Feb 2022 19:34:30 -0500 Received: from mail-ej1-x635.google.com (mail-ej1-x635.google.com [IPv6:2a00:1450:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 74AD7296900 for ; Wed, 16 Feb 2022 16:34:17 -0800 (PST) Received: by mail-ej1-x635.google.com with SMTP id d10so3025955eje.10 for ; Wed, 16 Feb 2022 16:34:17 -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=32dF3wm+g52NnE8DQB91PZHPpwomq5mRNnLyxvWUNLQ=; b=JbKRy81VTIkdZzhMQDMTPYqb445XGaPdvUkBXz3BrJBistMYZbkg+llEJ08x6Hr2jl zfQow6BTfc/FQx5ZDbPsBTF2TRX7/+f15uuBg71NiACV37+bFgKqnlBYAtTey+gQbRVV Q93AL8PN5GJIsIpmDFu0QztHw38YG3y4JjM1YOXw6cw9epvKqq7qvUfNzmqCqzikDtSM ev5uIVYkWJJk+DlS0B2Wj+PSUDoOoFK1g9wYL+J3aONhyLSV+P/OGPUHV0QtmHw15Q7d sMSth8O5Q55dp3mN7gBKgDgpQ7o2tunosV1NQiFJTp7V09xbEhfflLaJIU5oYrSel3nk 3O8w== 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=32dF3wm+g52NnE8DQB91PZHPpwomq5mRNnLyxvWUNLQ=; b=gZE+jTx/3FmvEjngUfggjdoWjAaDHk3O9PUy4jCa+lu9hbd2v6HkHVWG7R9ClSaxyX 7C9y8S86IJNWE54rN0KraWFH7zTonHeJyAHFXC2NgxGmmw4NFgQgycHozJQYbzAXu70r P7vTYzc+BYBpWBnqlHBY/BRLpzQcGQxTNG8aTVfg3lXQIjqq2H4evc9DUNckA2eA5Cof BoUxv/Jumc33W0wM8289uh1rhWQrdX1+Y5/AvwNPxrt4GvvAnwp6pIIEQiVAyH6tjIur LwhmcvKtn5FcRRJmw1bIfYLTE2fQPf1YG1Bg9wVaBRiZwkWDjOoBA9JoPMhWhihAoEpO RYEA== X-Gm-Message-State: AOAM531vaNq5bMMo/E83oSxZ7K62328gMsQpXXsdgDwAvr8VSYXmOSpE lzfb4/fQ+VuZ6CnoeHcgMgo= X-Received: by 2002:a17:906:858e:b0:6cf:d198:37a1 with SMTP id v14-20020a170906858e00b006cfd19837a1mr398091ejx.545.1645058055999; Wed, 16 Feb 2022 16:34:15 -0800 (PST) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id a11sm2383994edu.61.2022.02.16.16.34.15 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 16 Feb 2022 16:34:15 -0800 (PST) Date: Thu, 17 Feb 2022 00:34:14 +0000 From: Wei Yang To: Matthew Wilcox Cc: Andrew Morton , Wei Yang , peterz@infradead.org, vbabka@suse.cz, 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: <20220217003414.jmrdpv5ytoklz6yb@master> Reply-To: Wei Yang References: <20220106235254.19190-1-richard.weiyang@gmail.com> <20220107134059.flxr2hcd6ilb6vt7@master> <20220107160825.13c71fdd871d7d5611d116b9@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 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: >> On Fri, 7 Jan 2022 22:11:20 +0000 Matthew Wilcox wrote: >> [...] >> > > Hi, Matthew >> > > >> > > Would you mind sharing some insight on this check? >> > >> > It's right there in the comments. >> >> Well I can't figure out which comment you're referring to? > > * WARNING: bit 0 of the first word is used for PageTail(). That > * means the other users of this union MUST NOT use the bit to > * avoid collision and false-positive PageTail(). > >> > If you can't be bothered to read, why should I write? >> Hi, Matthew This change is introduced in commit 1d798ca3f164 'mm: make compound_head() robust'. As mentioned in the changelog. ``` That means page->compound_head shares storage space with: - page->lru.next; - page->next; - page->rcu_head.next; ``` We need to make sure those fields in page don't use bit 0 of the word. So this is an internal guarantee in struct page. I don't see the reason to compare page->compound_head and folio->lru here. Maybe I miss something. If you would explain a little, I would appreciate much. -- Wei Yang Help you, Help me