Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp314670lqp; Thu, 21 Mar 2024 01:53:15 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX4022ePTBnThWDJbiwZyJcwPs819PfrIYAq6XirBaaXUHPh0iUSdzO+iiNibmZlZbTcoF9tjs0gYHgVSDNT+3Xzur45xbklQOf7xBZJw== X-Google-Smtp-Source: AGHT+IHhIM9wD7nL5tBFWqFlMbAteX0mZkuzXtmavM8GuxfJoEeneKb050UNhy2DeWbdm7wjaKEp X-Received: by 2002:a05:6808:1692:b0:3c2:3b0e:b830 with SMTP id bb18-20020a056808169200b003c23b0eb830mr24973432oib.25.1711011193591; Thu, 21 Mar 2024 01:53:13 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711011193; cv=pass; d=google.com; s=arc-20160816; b=kGr3zQjeUekQ89kJWSawizZ14ShO6clUYFizhrkdkhT1YAUmSQKJibsWQIoBIKxq4h cR5lhJ6wgDDBpPcJIXX2a4NHCg0bNahE/yxuu82NuU3VWaKX5GJId+iZEUc/PSpaspYY 7QNUliAEzOGZTSuJOAy9mcay64YqMSwrNvDPuA1tInN3W3AJVTHsqzBpPoKvffgLgJcN Mw+F4towxZ5UEfgKWQgq0wkiwarpSQsykbOziSuFb4+tr3g172+DKQ3HnngDc2JzyzkT rTVI+s6271S8P04fu72FfmP+Tb4Y9U+tgYEHnZ9M5VcrWOfNG75Zm+iAUHX66AAkRd+i OxZg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=l1BTRSXrHIq3F5FfH3xQfP32h2f3qSELjna3jl+c3Uc=; fh=hTDDgOs6UeYLL9b6GvD5KQqb1t24mhES3qSwJd33RnU=; b=bpTesxIUpIcMi8BbCABvhxEj4x+6uzD0VQlTf9XcVJxNefOweV3l7a9FYtpKeFZ2iV gk4mW4tIdYFzCTdO+5ulfS2fgF0agBt74wR2SWu1DaXFgEAatcp4g66RAbtTiogbh5bN 1wh9mkSA+sh9S0yv47ZmWecKU0D4Db56WLTD0HpEfqwPMXoI8CE1LXcmwiEKEKpHrQag /h9BRSuAwLB5eIIBO5+EF54tr43eTGO/6CaGkSCvHhlOJVLigrcKfQxlxjRbUBWdQJwb 5xELqMr/Mb7FHFgYa91y4LI8ZmgSq2FnolK5ZGA6C8Rpegl1LXwn9KfhYqxsy68froEQ IYiw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-109804-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-109804-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id z17-20020a63c051000000b005dc8a171689si14424067pgi.411.2024.03.21.01.53.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Mar 2024 01:53:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-109804-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-109804-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-109804-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 539132843C1 for ; Thu, 21 Mar 2024 08:44:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4F0A2200D9; Thu, 21 Mar 2024 08:44:49 +0000 (UTC) Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5D52E12B81; Thu, 21 Mar 2024 08:44:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.187 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711010688; cv=none; b=UKk3cL7GvYSP62kUY4MVuXHBSnk+uU36/UWwRkoUXbtKtRxK7PSQGFg9D2hyBvG8JOfcjC3lgwobEPhrGkZ+sh3tWInQZ773JnLU3mqIwqw/ZH7wJ+eILtuG/gqtS69PNYDzbh6w6mSE1sIVNwy1aFWsGl9m/kHaGpOHte75Eiw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711010688; c=relaxed/simple; bh=X38p6OqcbJmyjiky0IhYh0PoLb64QszYO0PMJVelMzg=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=G/iDZM2CflGJAtnazjPHiQN8eseWr1ybpEFo9BNbc3V5PczuXnzc1vJFf2ELtDMjKH3h0sNsQqiWwpLuy7mulU1bYW7TrSk+jqsMa1sYRh5UYwbd6oiM9p2/6JcopNe/fh+7GcDUjiod2jYYIg/QI/oUL0rqua16+TedKmIKFuw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.187 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.88.194]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4V0dmx47bszwPv5; Thu, 21 Mar 2024 16:25:05 +0800 (CST) Received: from dggpemm100001.china.huawei.com (unknown [7.185.36.93]) by mail.maildlp.com (Postfix) with ESMTPS id 3B4921400DC; Thu, 21 Mar 2024 16:27:39 +0800 (CST) Received: from localhost.localdomain (10.175.112.125) by dggpemm100001.china.huawei.com (7.185.36.93) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Thu, 21 Mar 2024 16:27:38 +0800 From: Kefeng Wang To: Alexander Viro , Benjamin LaHaise , Christian Brauner , Jan Kara , , Matthew Wilcox CC: , , Kefeng Wang Subject: [PATCH 2/3] fs: aio: use a folio in aio_free_ring() Date: Thu, 21 Mar 2024 16:27:32 +0800 Message-ID: <20240321082733.614329-3-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20240321082733.614329-1-wangkefeng.wang@huawei.com> References: <20240321082733.614329-1-wangkefeng.wang@huawei.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To dggpemm100001.china.huawei.com (7.185.36.93) Use a folio throughout aio_free_ring() to remove calls to compound_head(). Signed-off-by: Kefeng Wang --- fs/aio.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/fs/aio.c b/fs/aio.c index d7f6c8705016..2c155be67b9a 100644 --- a/fs/aio.c +++ b/fs/aio.c @@ -334,14 +334,15 @@ static void aio_free_ring(struct kioctx *ctx) put_aio_ring_file(ctx); for (i = 0; i < ctx->nr_pages; i++) { - struct page *page; - pr_debug("pid(%d) [%d] page->count=%d\n", current->pid, i, - page_count(ctx->ring_pages[i])); - page = ctx->ring_pages[i]; - if (!page) + struct folio *folio = page_folio(ctx->ring_pages[i]); + + if (!folio) continue; + + pr_debug("pid(%d) [%d] folio->count=%d\n", current->pid, i, + folio_ref_count(folio)); ctx->ring_pages[i] = NULL; - put_page(page); + folio_put(folio); } if (ctx->ring_pages && ctx->ring_pages != ctx->internal_pages) { -- 2.27.0