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 09C4EC433F5 for ; Fri, 6 May 2022 01:21:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7C8B96B0071; Thu, 5 May 2022 21:21:40 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 776AE6B0073; Thu, 5 May 2022 21:21:40 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 63F3D6B0074; Thu, 5 May 2022 21:21:40 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 56A816B0071 for ; Thu, 5 May 2022 21:21:40 -0400 (EDT) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 2ED7020D4B for ; Fri, 6 May 2022 01:21:40 +0000 (UTC) X-FDA: 79433565960.07.C6CD0D1 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf20.hostedemail.com (Postfix) with ESMTP id A5B571C009E for ; Fri, 6 May 2022 01:21:32 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 40DCDB82E5D; Fri, 6 May 2022 01:21:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D3087C385A4; Fri, 6 May 2022 01:21:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1651800097; bh=ZkuCehv/fyf3T6rNBySZNsJqAeNnY8Im6FGBSgxBxhw=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=f4/7Rp+urKlXYRw5/nojJvP3ESJMMR6w62NLfJQVw7GKhc5LZ4nlBjWhvaB+OcECG /OVdZ+Kgjfic/YlkW0sh3nkWpUiKMiFApINFrEgYyi2YFSIoqx89kfFhxBzLC+iNol TVySWlm8Gl0QjNKt01QvQuk7pqHXJGhRQpLqBndU= Date: Thu, 5 May 2022 18:21:36 -0700 From: Andrew Morton To: "Matthew Wilcox (Oracle)" Cc: akpm@linuxfoundation.org, linux-mm@kvack.org, Neil Brown Subject: Re: [PATCH v2 08/26] swap: Convert add_to_swap() to take a folio Message-Id: <20220505182136.e003eb59f846bb7839be4f6f@linux-foundation.org> In-Reply-To: <20220504182857.4013401-9-willy@infradead.org> References: <20220504182857.4013401-1-willy@infradead.org> <20220504182857.4013401-9-willy@infradead.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Stat-Signature: i3a134fj38af5fi6m7h33yotkic5nb4g X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: A5B571C009E Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b="f4/7Rp+u"; spf=pass (imf20.hostedemail.com: domain of akpm@linux-foundation.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none X-Rspam-User: X-HE-Tag: 1651800092-181676 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 Wed, 4 May 2022 19:28:39 +0100 "Matthew Wilcox (Oracle)" wrote: > The only caller already has a folio available, so this saves a conversion. > Also convert the return type to boolean. > > ... > > --- a/include/linux/swap.h > +++ b/include/linux/swap.h > @@ -449,7 +449,7 @@ static inline unsigned long total_swapcache_pages(void) > } > > extern void show_swap_cache_info(void); > -extern int add_to_swap(struct page *page); > +bool add_to_swap(struct folio *folio); > extern void *get_shadow_from_swap_cache(swp_entry_t entry); > extern int add_to_swap_cache(struct page *page, swp_entry_t entry, > gfp_t gfp, void **shadowp); > @@ -630,9 +630,9 @@ struct page *find_get_incore_page(struct address_space *mapping, pgoff_t index) > return find_get_page(mapping, index); > } > > -static inline int add_to_swap(struct page *page) > +static inline bool add_to_swap(struct folio *folio) > { > - return 0; > + return false; > } > Neil's "mm: create new mm/swap.h header file" moved this to mm/swap.h. Simple enough. But mm/swap.h now gets its first mention of a folio yet it includes no prerequisites. I guess the includer is responsible for including the correct headers first, which is pretty sad, My fingers are itching to add a forward declaration `struct folio;', but I assume that isn't needed. We'll find out soon enough ;)