Received: by 2002:a05:7412:6592:b0:d7:7d3a:4fe2 with SMTP id m18csp651351rdg; Thu, 10 Aug 2023 15:05:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGhlYCcwGmartDEbRyaP/1VBYCBBvR5UxmaE7/yqbETpvjKd8p9dxoCaViO3ElZ8bznPFGo X-Received: by 2002:a19:691b:0:b0:4fe:3724:fdae with SMTP id e27-20020a19691b000000b004fe3724fdaemr2745029lfc.66.1691705114381; Thu, 10 Aug 2023 15:05:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691705114; cv=none; d=google.com; s=arc-20160816; b=j0746rh0i736X+Wwq6+EnJmJ5PbxR+UEWzslRI36n9MpMQEkV1KAe4dNYILMFQ6eiN layZASlF65qC6qlFCDlV9rUhNgLLGrkDRkY7IwRswgQtoKz8nBssLvuMAh78f5embdoF AFX2i710bIv21712ZMvvY3huAv9FREUuWeRldZOsw/j9beRvkwxxBD5OjcPBoCSBUuDT 1XBCtLlMsmLjkDs487/mXYByuM5pC6mI0TGf2tkN0c/67+pFMxqx3KK9nx68ttEMhfaw OcMsAFZeEXcRhBsy+PDQ+dnc9q6CQHAURaeJum3PDZUIb3eOVmk8uw7/kVs4IhFjyj07 4usA== 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=8vTYiM25zm5QiHj6u+PpIV7asjNd6laYCLcoo/Q4uEM=; fh=l4Xu2VRH6lwS9o/KZEosQpo6EmW+SWgDFsNTUydFFv8=; b=YZ/+jmlI9x1v/5DrH6AkwaKc07Kg5gPGoZEKuiqAIc6EPYMKwcee877xXDTrYmTrjU ZUVuceZC6AK+B+YJZTaghh7yn7u0U37tsUrOXNJ2gp6gv9NgJKn/vbr5E8lRfJVB6JKk O2x2D939VY3nGiGyw4a8+0paYgevt0y0djDwf4P4KjxWEoeeLMQyyTwCV9r3k6j0JrQ/ O+UqTpTwdb/+H66UCcVp3xgfaquMP2/swqcIiVkJ/Rmwom03fiUoLaKZY2MfJy2X9FYA 7cTr7DLdZuN8M29ipEyfklq8pYmLvRpP4ThBjv+uYZEcUjKMb1oiffyvmNw03bdkaVWb BpoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=cu+Q71lg; 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 y26-20020a056402135a00b005222ab8744bsi2234020edw.332.2023.08.10.15.04.39; Thu, 10 Aug 2023 15:05:14 -0700 (PDT) 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=cu+Q71lg; 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 S230344AbjHJVst (ORCPT + 99 others); Thu, 10 Aug 2023 17:48:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35054 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229481AbjHJVss (ORCPT ); Thu, 10 Aug 2023 17:48:48 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 48201273D; Thu, 10 Aug 2023 14:48:48 -0700 (PDT) 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=8vTYiM25zm5QiHj6u+PpIV7asjNd6laYCLcoo/Q4uEM=; b=cu+Q71lgi2lFBnmQy8bl+qJEDx QZlZ0QhUlUFNALuDSWWL+c7+IazU0lhKgqFpEE1l8uhytThtCeIUpEqOU0AwC0wpj2Z5fSCtLbg42 LUs1Peuo6wlCs+RGjk/Gmli+ibfliizbJVp2oiS0P7ywpoeA+VWpON6ewfLwOqpDjEV9TnUXXNk1w N8mEj5bdpk8i9GEbgYioVJpLuXNQZpqYX5N6nHkSplGlncS9sIGN8u5T9vYmaDoFJDWWX+i2Fe2tm 13XojrkrMCnf0GJskN5ceXd3f5GFKgtSjymEj9iBCrgOAnvi4jMujBg+jeOYH1dkI7DIPfHJEfkNU EjC3XOpQ==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1qUDWL-00Et27-RY; Thu, 10 Aug 2023 21:48:41 +0000 Date: Thu, 10 Aug 2023 22:48:41 +0100 From: Matthew Wilcox To: Peter Xu Cc: David Hildenbrand , Ryan Roberts , linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-doc@vger.kernel.org, Andrew Morton , Jonathan Corbet , Mike Kravetz , Hugh Dickins , Yin Fengwei , Yang Shi , Zi Yan Subject: Re: [PATCH mm-unstable v1] mm: add a total mapcount for large folios Message-ID: References: <20230809083256.699513-1-david@redhat.com> <155bd03e-b75c-4d2d-a89d-a12271ada71b@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Thu, Aug 10, 2023 at 04:57:11PM -0400, Peter Xu wrote: > AFAICS if that patch was all correct (while I'm not yet sure..), you can > actually fit your new total mapcount field into page 1 so even avoid the > extra cacheline access. You can have a look: the trick is refcount for > tail page 1 is still seems to be free on 32 bits (if that was your worry > before). Then it'll be very nice if to keep Hugh's counter all in tail 1. No, refcount must be 0 on all tail pages. We rely on this in many places in the MM.