Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp9645263rwd; Wed, 21 Jun 2023 09:57:38 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5up6y6tpOh2YsZ+dj/WH0F57nvD5uIBfY+E3VgfapOl/UoGS3deYUQQ77u9Z/CQazJXrVB X-Received: by 2002:a05:6e02:5c5:b0:341:e5f0:91e3 with SMTP id l5-20020a056e0205c500b00341e5f091e3mr12106614ils.4.1687366658114; Wed, 21 Jun 2023 09:57:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687366658; cv=none; d=google.com; s=arc-20160816; b=01EXVjHyoOApjG7Og0tjxH7MALG1Sjl1/8lkP/qM+Vmeem0Y+VKKr3FoP/s9M4p6SK 2BrrjX9Zl0WW7MKQ7+TtHaifXzzixlnw/Hj7qdKKkU2mSgUCRhg8frVrqPkIiSCqN0Ra sFgl3JsO2BOY2FKeaRCCpoKBjCKZ2wen32ru3dp46ex/Wz3nrWWvgkROKQ5+cZU8UuWB xvCT7hWNNz0L23e/ZIqHJLT0n8jckCVWHyEyTLsXvtnmfCF4QBE4IJbk2NS+u14K+gI7 t/g5dLwLWcENSZkSCVXlx/JXSzVLIp8LDxh9XLvZ8l4hJjqdhYMbokdDxA6QEgxhDiT7 WYMg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=KFMiCla2naG7Z7vKPwGKVD4TrVn4emFE0PLxxevs+7o=; b=HZTUTOzW1bola3EbXUdEepTLuQY674Z/aROXongxi0ixZcDAwsWbnCV5FcUCj1rcc9 mZPvA93zu4cnO6vflFUzJhYaS8Dr5SXksvIf8XlVJbM0OZuTWkwHumUXxtOdy+UnrgB5 ldXOPIhPLD1lKvNkOfc9bK+GpyOT0TsAMfcL1tJMg6F86yCToTC7qaOefgKkWrnBbJIe w4b34AxKuWbHE+jKHAY2PUsseqIsjxrH8FaCRePFCmgCl6B7moQM5psDpIAgFY4MsHh1 PCRGvFW6AdDodG0JDIEWXxnbOz2FFOknwEpixJNpqIfzF0KKvcALZ3Sf97xduMzusTRp KZ4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=OU4HmcXW; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y20-20020a63b514000000b0054ff0e193fesi4745341pge.225.2023.06.21.09.57.25; Wed, 21 Jun 2023 09:57:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-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=@infradead.org header.s=casper.20170209 header.b=OU4HmcXW; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230203AbjFUQqi (ORCPT + 99 others); Wed, 21 Jun 2023 12:46:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39580 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229809AbjFUQqY (ORCPT ); Wed, 21 Jun 2023 12:46:24 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 14F4419BE; Wed, 21 Jun 2023 09:46:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=KFMiCla2naG7Z7vKPwGKVD4TrVn4emFE0PLxxevs+7o=; b=OU4HmcXWzyUGQD65hDOdwkgu0o u74l9DMZxcBXT5V4Z5qLLe5pROXO6krjW5ruc1DT0SkscC1GAv6CUiRHqoT/xZNB+FTYdY7HTZcSC 1nPv6XnNmEo7hrUJxM01iosMG8Y0Ym2VcY6jvvzCBkvQC7lZJfWEJjt8YGSGMlqEn7izRDRm51hz1 GMTsyqcMH1J1dyYFMGFeU3Saag7AZyuOX2CkLBm+3ksa29C3VbudjYZzIgY5yxIiJcoHDGi0dytI4 BSi9r/ik6bNx2dBlS0BKcqh1/yQ1YIwWVl75bC6VUoMpy4h0Khgb2dDFrfbmsM3CyCJYXba2lPTTt z9KQ53Ag==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1qC0y1-00EjDi-Cc; Wed, 21 Jun 2023 16:46:01 +0000 From: "Matthew Wilcox (Oracle)" To: linux-mm@kvack.org, Andrew Morton Cc: "Matthew Wilcox (Oracle)" , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, intel-gfx@lists.freedesktop.org, linux-afs@lists.infradead.org, linux-nfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH 02/13] mm: Add __folio_batch_release() Date: Wed, 21 Jun 2023 17:45:46 +0100 Message-Id: <20230621164557.3510324-3-willy@infradead.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230621164557.3510324-1-willy@infradead.org> References: <20230621164557.3510324-1-willy@infradead.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham 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-nfs@vger.kernel.org This performs the same role as __pagevec_release(), ie skipping the check for batch length of 0. Signed-off-by: Matthew Wilcox (Oracle) --- include/linux/pagevec.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/include/linux/pagevec.h b/include/linux/pagevec.h index f582f7213ea5..42aad53e382e 100644 --- a/include/linux/pagevec.h +++ b/include/linux/pagevec.h @@ -127,9 +127,15 @@ static inline unsigned folio_batch_add(struct folio_batch *fbatch, return fbatch_space(fbatch); } +static inline void __folio_batch_release(struct folio_batch *fbatch) +{ + __pagevec_release((struct pagevec *)fbatch); +} + static inline void folio_batch_release(struct folio_batch *fbatch) { - pagevec_release((struct pagevec *)fbatch); + if (folio_batch_count(fbatch)) + __folio_batch_release(fbatch); } void folio_batch_remove_exceptionals(struct folio_batch *fbatch); -- 2.39.2