Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp839545rwl; Fri, 31 Mar 2023 03:12:47 -0700 (PDT) X-Google-Smtp-Source: AKy350b21X+WByHudV92HDl6Qs8aQQ7EA8CKum7muR5N8NZ5rqZo7fiIYAcfdnGBAGF6bJlhFuka X-Received: by 2002:aa7:8b1a:0:b0:628:630:a374 with SMTP id f26-20020aa78b1a000000b006280630a374mr24776113pfd.2.1680257566892; Fri, 31 Mar 2023 03:12:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680257566; cv=none; d=google.com; s=arc-20160816; b=ZYsjW/Pu//751Bv5XdmOUBn9hsX8ajLV1f7ddk1co2S2SZ/3xsDKZ4DeH7nrnjg0xK 6RhHS9oGMOGeJ1CquDz3CeP6Mk92d6JTC/xCFWalfVcMzJlcGw5gA0eG0nGMMiMSvZ/0 Zb9OApLvOnIn8ixtPgl6/fSxrtgMdCkIUneDcMjqoMB/wQjMdOp8hNPdPzp9Tt0qAfr1 ORiVZl0AJLxhuWIWr7PQ4M9a0nG+mq07nuUQNEC30QMm1aLVmDi62w+sUGwJ05u6qZp5 Oem/w3ZWg6zY5K0kCJ0L2pD9Ndc9R7VnMNWxenKJZmz1pN1fBtVVtfhQx6OxJQ/uq5Ii vA4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=V3Imsv5UXjIU6+jF5fHueU/SbtIe7EZ54LbcEh0yngg=; b=e3CBz0Fi4upAnpJadAbDMbECLUft4C+nwBa6HHDA2JXuZ7LCSqCNGeyIQVb30bDOLl AzrxZQ21nZcsG7ei/oCyXfSQVQ2M4IfwxktxZwAfe9uQCtlI3svrFcMt3owA4CXWRljK /KoNZR+GRpF59u5o539ICI0vXg5kjZpdMRQ3anMh6sTB3QG3oOL/GQi5sT0sEsWdWbeZ +nWupAj6sQZUZpMqfW1G3+NeE4L7MsRDTE8qdfFyF+9WcLL4BrHcy9BQuk3mV4q4xAKF XSJlsrdiHra8hvDVQ75R4kqoF0nz4u/P3AAlzRM3DsIG6N8cwamqLw2xkzunwsd6cYDZ NEcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bytedance.com header.s=google header.b=eNFqrrDv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=bytedance.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h126-20020a625384000000b00622b9204356si2095674pfb.204.2023.03.31.03.12.30; Fri, 31 Mar 2023 03:12:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bytedance.com header.s=google header.b=eNFqrrDv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=bytedance.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231713AbjCaKFz (ORCPT + 99 others); Fri, 31 Mar 2023 06:05:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39230 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230463AbjCaKFM (ORCPT ); Fri, 31 Mar 2023 06:05:12 -0400 Received: from mail-pl1-x632.google.com (mail-pl1-x632.google.com [IPv6:2607:f8b0:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 64C912C335 for ; Fri, 31 Mar 2023 02:59:41 -0700 (PDT) Received: by mail-pl1-x632.google.com with SMTP id ja10so20766932plb.5 for ; Fri, 31 Mar 2023 02:59:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1680256746; x=1682848746; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=V3Imsv5UXjIU6+jF5fHueU/SbtIe7EZ54LbcEh0yngg=; b=eNFqrrDvToe7K30uj4UJdlWR29i2x/3BZZ8yfzzbmfaNxY2ly4sLki8zpCNb1tZL8F 99yx1GqbvY+SYJq73zokyHO5yYeHmQJnsTNl0v83o99fAHuJVEQ3iu2Ib16n74m+GBc6 KsAfwyAiBRByPWGUGz3IRg5l0F2ly8Lt9XpJTZa82a9YVQ2YPetXTMGz0Qeub1rUNOGq 74U77/tjinuH4nZi8bz3ljpHvUvL6IyDLCusE4TSbGa1lAuOTOJGObcYtPfUSr5/0dr9 I6hoGTcoXl3etTMWvHtCYFopuFOlpdoY+jFPcvbTuHhYFNSPp/ax5X/xyzQpFYZJgU8p 5rhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680256746; x=1682848746; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=V3Imsv5UXjIU6+jF5fHueU/SbtIe7EZ54LbcEh0yngg=; b=MrSRfvKtNoxt7yrPhnKgdoEIm0htRMhudAlbi8V/Q76nziFaR+sC5efPdNPyWrqQmy LzWpYhz3eqkfswioMiRbQUQwRvy8ZGFlRzDN1cW3a53qEQBHUPsqUVqYAxlcqnV+BuFc oZA7Qy7P3zyayV9IyCUJYH1nTfZZ2UIlknZOoDGlh+KitgGegJLN94lWvMh0ByXF3Mq0 rAzebXNt4Agrwji0SwX970YQXU5JOcwh0Y+BlZPWE7KKJP/vhKCHS2Re73yO948wXafn VRmwpQGOD+eg0rDoKtwXt3+4ODv0+6R0xZAyLKU0kSfBdmM71Ayhtr60LS/6QTrqyVyx OEPA== X-Gm-Message-State: AAQBX9dLqEDZjmgcA22/1VYiCPdKiHINA8yxp9RWvTcVlGoURQvBSF0S Q4hmcm31WRBX4I9vtaVYMeD7qcvBME9BcOPDcKo= X-Received: by 2002:a17:902:7593:b0:1a2:8871:b430 with SMTP id j19-20020a170902759300b001a28871b430mr5594577pll.2.1680256746575; Fri, 31 Mar 2023 02:59:06 -0700 (PDT) Received: from C02DW0BEMD6R.bytedance.net ([139.177.225.229]) by smtp.gmail.com with ESMTPSA id oo5-20020a17090b1c8500b0023b3179f0fcsm4687782pjb.6.2023.03.31.02.59.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 Mar 2023 02:59:06 -0700 (PDT) From: Qi Zheng To: akpm@linux-foundation.org, willy@infradead.org, lstoakes@gmail.com Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Qi Zheng Subject: [PATCH 1/2] mm: swap: use folio_batch_reinit() in folio_batch_move_lru() Date: Fri, 31 Mar 2023 17:58:57 +0800 Message-Id: <20230331095858.51810-1-zhengqi.arch@bytedance.com> X-Mailer: git-send-email 2.24.3 (Apple Git-128) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In folio_batch_move_lru(), the folio_batch is not freshly initialised, so it should call folio_batch_reinit() as pagevec_lru_move_fn() did before. Signed-off-by: Qi Zheng --- mm/swap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/swap.c b/mm/swap.c index 57cb01b042f6..423199ee8478 100644 --- a/mm/swap.c +++ b/mm/swap.c @@ -222,7 +222,7 @@ static void folio_batch_move_lru(struct folio_batch *fbatch, move_fn_t move_fn) if (lruvec) unlock_page_lruvec_irqrestore(lruvec, flags); folios_put(fbatch->folios, folio_batch_count(fbatch)); - folio_batch_init(fbatch); + folio_batch_reinit(fbatch); } static void folio_batch_add_and_move(struct folio_batch *fbatch, -- 2.20.1