Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp1437315pxy; Fri, 23 Apr 2021 08:04:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwPrqNldqcMPhj79PjAnkTFAxkQTYsrUt5/RyArghfZWF7l9pZqIxDpfDCNVA/HGi0QmOx2 X-Received: by 2002:a62:770e:0:b029:261:d9ed:fd6a with SMTP id s14-20020a62770e0000b0290261d9edfd6amr4198126pfc.75.1619190248935; Fri, 23 Apr 2021 08:04:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619190248; cv=none; d=google.com; s=arc-20160816; b=NZK2wX2ZwAYJqbrbyVU8ppo/D0KIEa4g4+8WdAGhr8nU7irnDwI7LhmYiXUH+1V24Q BUShYI7SH/CYwaCPzyIIaCErdpGwAJh8n6pL6oIpqsWlqKdnWltuDrLbuPHkJOUA/R1W YJLJsHKZziuVx3A/88FPYECeu73lLhtPHIecsklDcI+cjSyckuJGB4N8nKgMGK3NEC5t HoiTp2veMlXIkCotbhUTB1x6pZ8BHsiZyAwYPKsKuBq/TeVwKU0WmYS0NWA/E84KDVwY KfzMhvX35USQ5w/DeF7tIWS3EzIT2nPPbl8XF61klsGBSnJsbugMGwmeR/18fyY1WZmA Gm+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=XwRlMFodbdowOoEaltOMndGpZ4VzHL/w/DIT1QGo5IU=; b=STzDc1DCPoisga/04SYg3exUysm1mc5HD7J81N9UOw+e1arTrqE5hLZM3MEMN1gyCZ 0NCdiRuYSweBR5CXFxbLvtwXIy4SR3Nq5evVGlo+GBpHit+UwyDrw8yspClt+Vq9IQhZ LfkNWcO/jNki+jhoWStcoemkzJWSDc/JRqqR1J4BxIvvxIXqpSE6SaumEP+c9zTkVlqb e9tZlVAj4GHQrvcvXnuVYjcC5wv9xDxlqhW7YbPa5JVgJy4oWhjjrWnv1H7Ol8ts1w1t WGMFPCPWTwUJhMnHd1Q5XzEJNo3q69F9fmuUpgc3N+PYJjMVBlzLJt+pXlVt6ZZPwG+S rezA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 15si6941956pgd.11.2021.04.23.08.03.56; Fri, 23 Apr 2021 08:04:08 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243603AbhDWPCq (ORCPT + 99 others); Fri, 23 Apr 2021 11:02:46 -0400 Received: from mx2.suse.de ([195.135.220.15]:39278 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243310AbhDWPCF (ORCPT ); Fri, 23 Apr 2021 11:02:05 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 01D15B14D; Fri, 23 Apr 2021 15:01:28 +0000 (UTC) Subject: Re: [PATCH 6/6] mm: Constify page_count and page_ref_count To: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org Cc: Andrew Morton , linux-kernel@vger.kernel.org References: <20210416231531.2521383-1-willy@infradead.org> <20210416231531.2521383-7-willy@infradead.org> From: Vlastimil Babka Message-ID: <960066da-c982-f6c7-ddce-73c054a6a843@suse.cz> Date: Fri, 23 Apr 2021 17:01:27 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.9.1 MIME-Version: 1.0 In-Reply-To: <20210416231531.2521383-7-willy@infradead.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/17/21 1:15 AM, Matthew Wilcox (Oracle) wrote: > Now that compound_head() accepts a const struct page pointer, these two > functions can be marked as not modifying the page pointer they are passed. > > Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Vlastimil Babka > --- > include/linux/page_ref.h | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/include/linux/page_ref.h b/include/linux/page_ref.h > index f3318f34fc54..7ad46f45df39 100644 > --- a/include/linux/page_ref.h > +++ b/include/linux/page_ref.h > @@ -62,12 +62,12 @@ static inline void __page_ref_unfreeze(struct page *page, int v) > > #endif > > -static inline int page_ref_count(struct page *page) > +static inline int page_ref_count(const struct page *page) > { > return atomic_read(&page->_refcount); > } > > -static inline int page_count(struct page *page) > +static inline int page_count(const struct page *page) > { > return atomic_read(&compound_head(page)->_refcount); > } >