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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 84342C433EF for ; Tue, 4 Jan 2022 08:02:56 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E37DC6B007D; Tue, 4 Jan 2022 03:02:55 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id DE7DC6B007E; Tue, 4 Jan 2022 03:02:55 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CD6E96B0080; Tue, 4 Jan 2022 03:02:55 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0036.hostedemail.com [216.40.44.36]) by kanga.kvack.org (Postfix) with ESMTP id BE6506B007D for ; Tue, 4 Jan 2022 03:02:55 -0500 (EST) Received: from smtpin24.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 7885F181BD7A9 for ; Tue, 4 Jan 2022 08:02:55 +0000 (UTC) X-FDA: 78991863510.24.96B76B8 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf11.hostedemail.com (Postfix) with ESMTP id E650D40006 for ; Tue, 4 Jan 2022 08:02:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; 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=L+nBXzCBePEjHa8sm/OnuvPfmwj+knLo0G6OwDWeDTA=; b=do2OIaqnke+f1IWh5/1C1f95Br Ti7QqWMRbXBhXuOZUwvxlw+rhyi9q9uIdUbw87JVW2DCxgHT7D2gNtSgdheZFMwYOFbJ0+r1dmsIl zyGKkVBTcLMR/YCBlE9TazbKe9Lz1ydd3/k3JzdRY2+nik/4zGHPgBUIX9H+4hc2SGjPo84kumvCU Wy/i9omTBrZJ63wFqetp7q4E6KsNoksqPL5O+jYldCOjbs5omtgE+PMQRe2H1o2gexDck9MVITsoT OwQNbhKeQ2Cfd5zxeiUI05tNcHN4sLCc5v2l8CodMBsjm3yODdLhfFsEwzNO2CY6C3ec+now6viFp bZYhBvDQ==; Received: from hch by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1n4emU-00Aash-0X; Tue, 04 Jan 2022 08:02:54 +0000 Date: Tue, 4 Jan 2022 00:02:53 -0800 From: Christoph Hellwig To: "Matthew Wilcox (Oracle)" Cc: linux-mm@kvack.org, John Hubbard , Andrew Morton Subject: Re: [PATCH 03/17] mm: Add folio_pincount_ptr() Message-ID: References: <20220102215729.2943705-1-willy@infradead.org> <20220102215729.2943705-4-willy@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220102215729.2943705-4-willy@infradead.org> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: E650D40006 X-Stat-Signature: qunqufdh47jfqm6y5u7komujtq39f6of Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=do2OIaqn; spf=none (imf11.hostedemail.com: domain of BATV+e6cc8b46eea779d11ede+6708+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=BATV+e6cc8b46eea779d11ede+6708+infradead.org+hch@bombadil.srs.infradead.org; dmarc=none X-HE-Tag: 1641283370-608664 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 Sun, Jan 02, 2022 at 09:57:15PM +0000, Matthew Wilcox (Oracle) wrote: > This is the folio equivalent of compound_pincount_ptr(). > > Signed-off-by: Matthew Wilcox (Oracle) > --- > include/linux/mm_types.h | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h > index c3a6e6209600..09d9e2c4a2c5 100644 > --- a/include/linux/mm_types.h > +++ b/include/linux/mm_types.h > @@ -309,6 +309,12 @@ static inline atomic_t *compound_mapcount_ptr(struct page *page) > return &page[1].compound_mapcount; > } > > +static inline atomic_t *folio_pincount_ptr(struct folio *folio) > +{ > + struct page *tail = &folio->page + 2; > + return &tail->hpage_pinned_refcount; Missing empty line? Except for that and the fact that I dislike the pre-existing magic numbers this looks fine. Reviewed-by: Christoph Hellwig