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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 582D6E810DB for ; Wed, 27 Sep 2023 12:41:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=MS2CZGPkkqxfXm4UNc/NKQpVxs9XfV6OA7QhEMdbutw=; b=Y1I7V3UeIc/h/Y vnaizqebw6aEu2uAHSBthu+qzk0JsdfQpd9TSRCWwdi0N6Ut4WkbMBduR7vSu1vLuAfTrDyWpP0Fg SJBUZqiq+YTN8lc0vgtdmxepnDqVVNc1b+wVrwOwP4RTFxae9h8KTvEVmskBwk5pynSC/f6O6ds/Q nV1vbu0oKGM9i6mFXDxLXik9NWmyMtQ16FX00gf6EtnRMj0/GE1vUq0mr5biKHQs1MgxnDsZMNkiH y9rjuqaGfnGAVODvI7LK1ZlWxEpQXJYnJMTaMHndDwvirga71Lj3t85+Lq3zmojuT6Y05SeZz6Atx k4Mb9W+CAE9rt+soEwcw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qlTqc-000v1i-2B; Wed, 27 Sep 2023 12:40:58 +0000 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qlTqT-000uyZ-29 for linux-arm-kernel@lists.infradead.org; Wed, 27 Sep 2023 12:40:51 +0000 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-405417465aaso101049295e9.1 for ; Wed, 27 Sep 2023 05:40:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1695818446; x=1696423246; darn=lists.infradead.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=zXUOi+JREodzQHSQ402wcT88ukT7b7/9+gTGSenR88w=; b=2xSj1pPE/NOMeQMMJci/TOi8ASBWyg+O/zyzwP2I9gxl0ddCuK1IfmOjBbG1qePDuT tB0tXMJxxupyW607+FcGxdn6rPWQvhtmoAcSOvfIh2plc6724jGXTif+RL7MrDUs/xGK i2c858GFJXdvU69wbJuL71swIy4vHVlDGpSFUGDxFXSA3VNPSbGbyya1fByKAxFi9Rf7 3YErXZDNb2sG4jQu7TkC2CSvMlggeatsP9H+c7zgsb2UaGbXaEK9sf5AiAEL7G3kvSGp ACCgb2205HImGHBcp+2qOhCop6RegzoPEz9IcDo5x/RYulqRU5D+lwOASjRkD6ZFQ1Rd xOEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695818446; x=1696423246; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=zXUOi+JREodzQHSQ402wcT88ukT7b7/9+gTGSenR88w=; b=EdrgDuakfKDux/H8Mn58BpzVR9YQdPw+7QLcEbPQWynENvEgxwY9EurKT79wXJXYpF I1YtPm70zcgIqszIWWjkw5D4+QBB2l/t19J7rxNIjFWQCo7B0i4DT0CvmbHUYiz12S2O 6BbYlpommhPReSPfzQEgqvz3uTyqlLC/sqUqxBm1C4x1bH0/8wEm+YgOnIaS7kRgIrgV C+WlPro0nSd96qQ/nTc7IqG2620GcJoT0rVe/n8virZgnpebBfhJ1PrvlFQgefwGvJGe fAXa1t3c5dCabbYdDKuOXIdQpTOzj32ziAUyoW8kxhCeqYLkN2UZbhphLuLrlHd3nAk7 V1fg== X-Gm-Message-State: AOJu0YxviWDeMa+0el6+X1kcubNQIqNiWDtMEHVSXcFwukM836VqVI4S Ygq5gIJYNEbKKUSWcZrOkHZNdQ== X-Google-Smtp-Source: AGHT+IHTiJfzH4R2S2zx3UycaTxvv70UewfXLJAgimn3+0N5yJ9BUcEJoD5bNo9nIy1/zyCbRvn2nA== X-Received: by 2002:a05:600c:b52:b0:406:3fda:962c with SMTP id k18-20020a05600c0b5200b004063fda962cmr1734995wmr.31.1695818446474; Wed, 27 Sep 2023 05:40:46 -0700 (PDT) Received: from google.com (65.0.187.35.bc.googleusercontent.com. [35.187.0.65]) by smtp.gmail.com with ESMTPSA id j10-20020adfd20a000000b003142ea7a661sm10613871wrh.21.2023.09.27.05.40.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Sep 2023 05:40:46 -0700 (PDT) Date: Wed, 27 Sep 2023 13:40:42 +0100 From: Vincent Donnefort To: Matthew Wilcox Cc: maz@kernel.org, oliver.upton@linux.dev, kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, kernel-team@android.com, will@kernel.org Subject: Re: [PATCH v1 1/2] KVM: arm64: Do not transfer page refcount for THP adjustment Message-ID: References: <20230926181932.1650692-1-vdonnefort@google.com> <20230926181932.1650692-2-vdonnefort@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230927_054049_701951_BCEA932B X-CRM114-Status: GOOD ( 19.17 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Sep 27, 2023 at 08:00:28AM +0100, Matthew Wilcox wrote: > On Tue, Sep 26, 2023 at 07:19:31PM +0100, Vincent Donnefort wrote: > > With folios, GUP affects a refcount common to all pages forming the THP. > > There is therefore no need to move the refcount from the tail to the > > head page. Under the hood it decrements and increments > > the same counter. > > FYI, this isn't new to folios. get_page() has _always_ operated on the > head page of a compound page. Here's how it worked in 2.6.12-rc2: > > +static inline void get_page(struct page *page) > +{ > + if (unlikely(PageCompound(page))) > + page = (struct page *)page->private; > + atomic_inc(&page->_count); > +} > > I can't be bothered to switch over to the linux-fullhistory tree and > show how it evolved, because i think this sufficiently makes the point -- > you can backport this patch as far as you like. Thanks for having a look! I'll refine that description in the next version. > > Folios just make it obvious that this is what's going on. And that's a > good thing! Making the MM less inscrutable is a win for everybody. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel