Received: by 2002:a05:7412:40d:b0:e2:908c:2ebd with SMTP id 13csp192574rdf; Mon, 20 Nov 2023 22:52:48 -0800 (PST) X-Google-Smtp-Source: AGHT+IEsHCrEX8rja7RGqU6jyqZSqmx3V2qVc7ANONjhqMnWwxOXxdkJTdDX8HNowbiFJaPtYC/b X-Received: by 2002:a05:6a20:1588:b0:151:35ad:f331 with SMTP id h8-20020a056a20158800b0015135adf331mr2396236pzj.14.1700549568352; Mon, 20 Nov 2023 22:52:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700549568; cv=none; d=google.com; s=arc-20160816; b=aAeJqV21cKtzlK63m2rDgpDWM0Mnb1esK6maGaWAiw67mcReD2F3Zo077B4FtkHYQT MwB+UQTpCFTR2m6x64GEs1xeCSc7odZmCoRKt4KaVAwzbTDcXeRdJ+n2tKCu5RPydyx5 Sv01BOpUp1wgkECbyZJWBe509D+U4F1f6NxO1wGtkS27zUiDBIlO4vG4M25Z7j+qYbem KaT8Xm6ZO4jP7h9JuX8w/URpR6ulbmR0D/18ZqQi6bnP7BtFZt1oEHMKn1lbKjdv1wOu xx1qQqsH2yecV9mUPKanAUHDaMbyezBDb1LGbsSzCavhJvY1NIit/Y9ayr7hOGz5ovT8 l/4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=rg0vf7snjrv8JObGfk+WLn0zJ5rxbtrKIUbLse5CtcY=; fh=v/j7QEwtsj+94eMIzch1qbwAijHXRMR6IcasrHCGlTE=; b=0XVcddUJFwe8c/tE96vPcouZSgIReNEruXb+iRUC2zb+zZE/KI8NwlzKX4FkxrNhYk EVTxz2816AUgvVgEbHoBG5eOUQNXYHeBbELmdrZkZElJcf9oGxd4pS1RDCRS2cfraWig ggpA2Pk/2PG8cBpCRP1OEK7rUjfZAh9mHpJBEfFLPcUEwIpp47MTN5lVjY0u4E9H5oB9 slXs9T6jhPksMJcp5r3su3j2UI4n1bEnnGnzicIVYZF4X9hlSztTq0n5PppPtuZvSgZS zrIdV92LZEhBASjOZY9uGqIU2vDlU9j5CfEXyQ8nIyklXiAELNaw0siFNsRfccsOJWq4 wkCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Kr/S+GB4"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id s7-20020a656447000000b005c1b303c414si9669000pgv.625.2023.11.20.22.52.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Nov 2023 22:52:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Kr/S+GB4"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 24ECF805E414; Mon, 20 Nov 2023 22:51:51 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230243AbjKUGvm (ORCPT + 99 others); Tue, 21 Nov 2023 01:51:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41518 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229568AbjKUGvl (ORCPT ); Tue, 21 Nov 2023 01:51:41 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 88872F4 for ; Mon, 20 Nov 2023 22:51:37 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 22EFFC433CC for ; Tue, 21 Nov 2023 06:51:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1700549497; bh=vcMj82j5UeYxk5/OU71PGwNMQQLupr6YDQ+K2CdWuTk=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=Kr/S+GB4e3na4m45XZknkUKpEmXhdtsl/hwxQraKXKJ1EkiFUoLjYsitKPSpoJtVm 3DkJ4KsXFcwXDkN9R+YK/wqIKpVQrArNtltULfKSK/A2gbWZqWV4cyBy3r3+TGj7eq OdLqKXF5dV6NkJHj9tD30LKzCILXoESDubrSbKpW0UVw18N69nK19gw5ryYhyYtV6/ HWrjCJrP2wOE9fSUz5Cncs81AW6rpAd8YyxzS0693fGXmx9R5sroJqRE5sv+gFsDXo Z4Pp29Xb3bSYZAffs0rvcjXUSJb5ems8icbSzrSQ6E8Q0t3gih8N+zbvK8ANacwqAC 9FOQxFpiebsHg== Received: by mail-pj1-f45.google.com with SMTP id 98e67ed59e1d1-283a0b0bd42so2340445a91.0 for ; Mon, 20 Nov 2023 22:51:37 -0800 (PST) X-Gm-Message-State: AOJu0YyTtaT/zS3jYOOORpq9cXbo3SkqkqDGjPhzSRQh3suRHlZBPapo +VPD4KSR8xRlmZO0UnodL6btnTD9ACjcSAbEOfYCfQ== X-Received: by 2002:a17:90a:854c:b0:280:4af4:1a41 with SMTP id a12-20020a17090a854c00b002804af41a41mr2745780pjw.15.1700549496540; Mon, 20 Nov 2023 22:51:36 -0800 (PST) MIME-Version: 1.0 References: <20231119194740.94101-1-ryncsn@gmail.com> <20231119194740.94101-8-ryncsn@gmail.com> In-Reply-To: <20231119194740.94101-8-ryncsn@gmail.com> From: Chris Li Date: Mon, 20 Nov 2023 22:51:25 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 07/24] mm/swap: move swap_count to header to be shared To: Kairui Song Cc: linux-mm@kvack.org, Andrew Morton , "Huang, Ying" , David Hildenbrand , Hugh Dickins , Johannes Weiner , Matthew Wilcox , Michal Hocko , linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Mon, 20 Nov 2023 22:51:51 -0800 (PST) Hi Kairui, On Sun, Nov 19, 2023 at 11:48=E2=80=AFAM Kairui Song wro= te: > > From: Kairui Song > > No feature change, prepare for later commits. Again, I don't see the value of having this as a stand alone patch. If one of the later patches needs to use this function as external rather than static, move it with the patch that uses it. From the reviewing point of view, it is unnecessary overhead to cross reference different patches in order to figure out why it is moved. Chris > > Signed-off-by: Kairui Song > --- > mm/swap.h | 5 +++++ > mm/swapfile.c | 5 ----- > 2 files changed, 5 insertions(+), 5 deletions(-) > > diff --git a/mm/swap.h b/mm/swap.h > index f82d43d7b52a..a9a654af791e 100644 > --- a/mm/swap.h > +++ b/mm/swap.h > @@ -61,6 +61,11 @@ static inline unsigned int folio_swap_flags(struct fol= io *folio) > { > return page_swap_info(&folio->page)->flags; > } > + > +static inline unsigned char swap_count(unsigned char ent) > +{ > + return ent & ~SWAP_HAS_CACHE; /* may include COUNT_CONTINUED flag= */ > +} > #else /* CONFIG_SWAP */ > struct swap_iocb; > static inline void swap_readpage(struct page *page, bool do_poll, > diff --git a/mm/swapfile.c b/mm/swapfile.c > index 0142bfc71b81..a8ae472ed2b6 100644 > --- a/mm/swapfile.c > +++ b/mm/swapfile.c > @@ -114,11 +114,6 @@ static struct swap_info_struct *swap_type_to_swap_in= fo(int type) > return READ_ONCE(swap_info[type]); /* rcu_dereference() */ > } > > -static inline unsigned char swap_count(unsigned char ent) > -{ > - return ent & ~SWAP_HAS_CACHE; /* may include COUNT_CONTINUED fl= ag */ > -} > - > /* Reclaim the swap entry anyway if possible */ > #define TTRS_ANYWAY 0x1 > /* > -- > 2.42.0 > >