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=-8.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 1DA43C433B4 for ; Tue, 6 Apr 2021 14:21:36 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id AD219613A7 for ; Tue, 6 Apr 2021 14:21:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AD219613A7 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=shutemov.name Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 458EA6B0081; Tue, 6 Apr 2021 10:21:35 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3F7166B0082; Tue, 6 Apr 2021 10:21:35 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 26FFE6B0083; Tue, 6 Apr 2021 10:21:35 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0226.hostedemail.com [216.40.44.226]) by kanga.kvack.org (Postfix) with ESMTP id 0EE8E6B0081 for ; Tue, 6 Apr 2021 10:21:35 -0400 (EDT) Received: from smtpin01.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id BCE03824934B for ; Tue, 6 Apr 2021 14:21:34 +0000 (UTC) X-FDA: 78002155308.01.C56F5E9 Received: from mail-lf1-f45.google.com (mail-lf1-f45.google.com [209.85.167.45]) by imf11.hostedemail.com (Postfix) with ESMTP id E00A32000255 for ; Tue, 6 Apr 2021 14:21:29 +0000 (UTC) Received: by mail-lf1-f45.google.com with SMTP id d13so23052393lfg.7 for ; Tue, 06 Apr 2021 07:21:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shutemov-name.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=z4dXCA52eL9yGYEpPl96DmhaClVisBUZpt2xtmJBb8M=; b=X77QCn7n498c3YiPPqKnvfoDK1ALPoIzwOTOdapWUWwuKzdsQ3xWo/OznfYtfC3dGj rb0TAx5ZQC0MHX4OKg93zU6SjTAMKpJ9IcYP3bKj13S8/eM2pzb4yWt4axt8JMso//Cv DtdbXbOFBKwVnfgjZVMu68klEoBuAPo3x6w0B8KQjNFgtEMSmUeIz//i7CwJB9nK2jBL CdTnOlED4hyt46OO+HDicforXu3Edsso60+o5DqQz2N+4lg33wQRM3d5d3Lib5pxsAVq e4jIuZVi2GXr4sX+l5N9xLdgqRGdIz4WleLpCls93DJZgbgGbuB9IcRkc+/LYLC0cWY8 8v0Q== 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; bh=z4dXCA52eL9yGYEpPl96DmhaClVisBUZpt2xtmJBb8M=; b=tW6kkd2UPDOLa/nv4noMdPi6dGmM2ltBrqnd8gPzJ4LOJ8Slh4FMcns4L9t6l8v3b7 1lW05gcQTTG0Un7MO0E14RIuemgvF10SeyTsDOYR7/O34bU4NNY+w12jqbO8lN7QLP3V JuOF6zpTtDfDtDod6geCjMLaR+Dh748NMbqxbloivo87sLfQ/yVk9ejJktgs/RFqNhLP QLD8kQmvl8OHAIzO/7wedYYFATiEBYOIAA+34l3t2X6Sw1IXzuB0oepKIRYnxbPyT8ec +MEuvQcIrBe4iwaVd0l9lDHm+h5UKaWTHmdZaIbOvy+y5/AJm8ARUYX034l82fIvWv8f 3ctQ== X-Gm-Message-State: AOAM532objR/3Yhp5EVXEn3X+8AvRhUKMUop6VHGfmPBfIsBaNHGXp10 hUtItFuXfd1c9ci5hr31Zh6JhQ== X-Google-Smtp-Source: ABdhPJwF9aOPC9ghWeCjNX8vk/cr/PjNYGMD/2j84h1aHqOpZ4D87I8y7s/rUF+6j04Rmu5y2i8WMA== X-Received: by 2002:ac2:4111:: with SMTP id b17mr20833051lfi.96.1617718892692; Tue, 06 Apr 2021 07:21:32 -0700 (PDT) Received: from box.localdomain ([86.57.175.117]) by smtp.gmail.com with ESMTPSA id f8sm2174697lfs.143.2021.04.06.07.21.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Apr 2021 07:21:32 -0700 (PDT) Received: by box.localdomain (Postfix, from userid 1000) id F2E47101FF7; Tue, 6 Apr 2021 17:21:34 +0300 (+03) Date: Tue, 6 Apr 2021 17:21:34 +0300 From: "Kirill A. Shutemov" To: Matthew Wilcox Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-cachefs@redhat.com, linux-afs@lists.infradead.org Subject: Re: [PATCH v6 01/27] mm: Introduce struct folio Message-ID: <20210406142134.tkxyy7ytib7vubf4@box.shutemov.name> References: <20210331184728.1188084-1-willy@infradead.org> <20210331184728.1188084-2-willy@infradead.org> <20210406122918.h5dsnbjhmwpfasf4@box.shutemov.name> <20210406124807.GO2531743@casper.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210406124807.GO2531743@casper.infradead.org> X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: E00A32000255 X-Stat-Signature: i1wa6fndhjhsenwa5h1ce1aq3ju1rbff Received-SPF: none (shutemov.name>: No applicable sender policy available) receiver=imf11; identity=mailfrom; envelope-from=""; helo=mail-lf1-f45.google.com; client-ip=209.85.167.45 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1617718889-103332 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 Tue, Apr 06, 2021 at 01:48:07PM +0100, Matthew Wilcox wrote: > Now, maybe we should put this optimisation into the definition of nth_page? Sounds like a good idea to me. > > > +struct folio { > > > + /* private: don't document the anon union */ > > > + union { > > > + struct { > > > + /* public: */ > > > + unsigned long flags; > > > + struct list_head lru; > > > + struct address_space *mapping; > > > + pgoff_t index; > > > + unsigned long private; > > > + atomic_t _mapcount; > > > + atomic_t _refcount; > > > +#ifdef CONFIG_MEMCG > > > + unsigned long memcg_data; > > > +#endif > > > > As Christoph, I'm not a fan of this :/ > > What would you prefer? I liked earlier approach with only struct page here. Once we know a field should never be referenced from raw struct page, we can move it here. But feel free to ignore my suggestion. It's not show-stopper for me and reverting is back doesn't worth it. I went through the patchset and it looks good. You can use my Acked-by: Kirill A. Shutemov on all of them. Thanks a lot for doing this. -- Kirill A. Shutemov