From patchwork Wed Oct 2 04:01:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 13819305 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 BCB30CF3196 for ; Wed, 2 Oct 2024 04:01:22 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 305B1440174; Wed, 2 Oct 2024 00:01:19 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 17691440175; Wed, 2 Oct 2024 00:01:19 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EE14F440174; Wed, 2 Oct 2024 00:01:18 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id BD9C6440175 for ; Wed, 2 Oct 2024 00:01:18 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 410721A07EE for ; Wed, 2 Oct 2024 04:01:18 +0000 (UTC) X-FDA: 82627312236.03.BC7066D Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf03.hostedemail.com (Postfix) with ESMTP id 9854D2000A for ; Wed, 2 Oct 2024 04:01:16 +0000 (UTC) Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=cZ7AVepj; dmarc=none; spf=none (imf03.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1727841535; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=COJ8f3y8IG0H+Q9xXoJdJ9ujTm4oeQQb1jUdkdnvJ4Q=; b=kPB+XAAyPJUkkWAQZcI8kqt/l20rUbJKVHqDBo9q8/fYUuJquh8Ud8s0j/gH3cedeedPdX dpqDlfqxHccCSxcx4hyDhzzcOVTZ4GbLi2OyfuGATI54N3O1MQleMWyLo7+f8r6gzOcBH4 OGtnVYPwsWUpfTtsMbJT0BYWkCH9lYM= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1727841535; a=rsa-sha256; cv=none; b=qxWtsW6qJ/fDakn1u56FH8fijTuW1PcCY/YtSuEfjDx1iLCdgLjju1WDZIgweQ0GbVbQrR T2zYXLknY8Ggp+x9LLZmdrQwf7bQezqS9cX01ry3m/c3wiH3n7OvOerHju0XIpBNKVEvYM BiCgOLoro00aYLP26W4bHy7U7yGSAWQ= ARC-Authentication-Results: i=1; imf03.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=cZ7AVepj; dmarc=none; spf=none (imf03.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org 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=COJ8f3y8IG0H+Q9xXoJdJ9ujTm4oeQQb1jUdkdnvJ4Q=; b=cZ7AVepjiSMgq/Oh5aKY9/VDa0 gRhmlq5wCZ23wsBbm/Ko4q2nW+MPdwngGy0X3df0Zvy4L/zpwvaLBy8VGiVdFbJwCNZhLXMMsZ1wt /pB8l05ekw0/hTNr3boaDx7x2KmJWkL9y+KIMcSNQcUgmP3pOn+60JPFz5nkH1GZnVtE0+kWHOo5p u4LbdLTtiHAJ6rwONcKSdCxpgmIYHOkTXnqyc3QovQUVpzE2w6iVNh+nqUbZOyptS4klJsACK34Rm xGZ6zrsbHGsmgwF9lSof4rXDk9i4ok3DkyOQHEMs9ECO7U3XNb9XdcavFpe8MAC8kl0hxbM5Uafxo 6kA9ylbA==; Received: from willy by casper.infradead.org with local (Exim 4.98 #2 (Red Hat Linux)) id 1svqY6-00000004I8b-09mw; Wed, 02 Oct 2024 04:01:14 +0000 From: "Matthew Wilcox (Oracle)" To: Christian Brauner Cc: "Matthew Wilcox (Oracle)" , linux-fsdevel@vger.kernel.org, ceph-devel@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-nilfs@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 5/6] ceph: Remove call to PagePrivate2() Date: Wed, 2 Oct 2024 05:01:07 +0100 Message-ID: <20241002040111.1023018-6-willy@infradead.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20241002040111.1023018-1-willy@infradead.org> References: <20241002040111.1023018-1-willy@infradead.org> MIME-Version: 1.0 X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 9854D2000A X-Stat-Signature: cufm4i7eefoatpett19w4g8i8zyzampt X-Rspam-User: X-HE-Tag: 1727841676-170401 X-HE-Meta: U2FsdGVkX1/lX0qNKwdFIXDCuZuhQi/xsfaE3Fvn6j7Z9wFzovTtRPiJKm7H1Db+DGM6N649ZiPay5bSn8+UuUwi9Ggbq1QNztB34+iTNh3GT3y+5viOi2stq7WlNZr3TgyCPRdp55WY8mBrVxK0fNUMdFRiKsFCDXiHE8i9MiIAcZyBO4nASxDmFDXF/mFPS3tSM1fcMTwcp2Vdtvv1zrxgenjUn36rhaRqF1NaOEk3tWqWCi2t2ZHaAzXwPPOR//hauXLPnDjXpPjwQ2x5c71+thFav6FFGO9ILFI9avE7yhId0LwM4yFn44j+RVL72sUq4Zsuwcaaq2z+YJn3Sx23M/+NU/a3V34WNTVmTcLj76IPDIwI7Lgtggy4rQsuLmHC7vO4/nfQOGYqDn8Uk+wb1URqa9V6niC6wWGUUUBz1o5mnRPQ2Qxi7VS6jeoRre2YU+24Mt7JELypVDFcbtDjnYzQLAcgfyHxzMC/0S4Ogi+L3MYfKUoHtO5066pC/ISiA2qw5bVAo+GYsWxdeZ06mqZRm33fkes+rwXLSdH5YT6Y51evaarOjOfwKUYphKuwX8D7uekQrRzvQ/pP119xfMyjqeiUKwbZNGYHB6rFfYpjWBXwgK+/dWy8e0WRayMmMhn0kEvH7UrHbf2OYhRFV+MThPyCnqb+r6WPCYwLBUb4cDTVXwDtMlUWjjS4+dcbQsygQEX4q9Dde0Mm4BmKo/0gTDvcHqdkLQ7pq3Q8sWspoPcwYIuFvcJOle/Fp4xR98dw2VbWky0JOmIKPfRlTEwxOxclkpKw9VBimnhu6AUFhpb8v7IxNASoLHaurBUR4VXynNBP6Eo8IabyrWFeXDU/4c05g9xsxZBxzhwKumaQXdzd8qEpXjkqpSEk1ztjwwTUFVAjc3q91k3pBaeOiDqKPQguC396k1NZAEauAuqs4eioafjd/SbjI+/Jf+9Jmi40pypOZ02DhZo SRoZHzEh o5yaUeuK/4qzayuYtRYSB/u6O6LT2BbevcAXRVSM+YvQtkfksxfAHXJAmLHozYSZkZd5xP3svMl9ZLqlN8ViYQq8x0iih/F1+7UJhvnKOV5gg33zk8Kmqj6+VOaE7Ig0xDiAJv6HbwfW0sH1AXXwg36yP6HoRgn6e7Impov+1RJh67eyqhMDJ4TN1w4z/N12RJdCW+rwcb55RN9Ra3NUDKqtfiPN6GC0SagL+d9G0A9skpBg= 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: List-Subscribe: List-Unsubscribe: Use the folio that we already have to call folio_test_private_2() instead. This is the last call to PagePrivate2(), so replace its PAGEFLAG() definition with FOLIO_FLAG(). Signed-off-by: Matthew Wilcox (Oracle) --- fs/ceph/addr.c | 20 ++++++++++---------- include/linux/page-flags.h | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c index 53fef258c2bc..a8788e300dc7 100644 --- a/fs/ceph/addr.c +++ b/fs/ceph/addr.c @@ -1051,7 +1051,9 @@ static int ceph_writepages_start(struct address_space *mapping, if (!nr_folios && !locked_pages) break; for (i = 0; i < nr_folios && locked_pages < max_pages; i++) { - page = &fbatch.folios[i]->page; + struct folio *folio = fbatch.folios[i]; + + page = &folio->page; doutc(cl, "? %p idx %lu\n", page, page->index); if (locked_pages == 0) lock_page(page); /* first page */ @@ -1078,8 +1080,6 @@ static int ceph_writepages_start(struct address_space *mapping, continue; } if (page_offset(page) >= ceph_wbc.i_size) { - struct folio *folio = page_folio(page); - doutc(cl, "folio at %lu beyond eof %llu\n", folio->index, ceph_wbc.i_size); if ((ceph_wbc.size_stable || @@ -1095,16 +1095,16 @@ static int ceph_writepages_start(struct address_space *mapping, unlock_page(page); break; } - if (PageWriteback(page) || - PagePrivate2(page) /* [DEPRECATED] */) { + if (folio_test_writeback(folio) || + folio_test_private_2(folio) /* [DEPRECATED] */) { if (wbc->sync_mode == WB_SYNC_NONE) { - doutc(cl, "%p under writeback\n", page); - unlock_page(page); + doutc(cl, "%p under writeback\n", folio); + folio_unlock(folio); continue; } - doutc(cl, "waiting on writeback %p\n", page); - wait_on_page_writeback(page); - folio_wait_private_2(page_folio(page)); /* [DEPRECATED] */ + doutc(cl, "waiting on writeback %p\n", folio); + folio_wait_writeback(folio); + folio_wait_private_2(folio); /* [DEPRECATED] */ } if (!clear_page_dirty_for_io(page)) { diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index 35d08c30d4a6..4c2dfe289046 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h @@ -543,7 +543,7 @@ FOLIO_FLAG(swapbacked, FOLIO_HEAD_PAGE) * - PG_private and PG_private_2 cause release_folio() and co to be invoked */ PAGEFLAG(Private, private, PF_ANY) -PAGEFLAG(Private2, private_2, PF_ANY) TESTSCFLAG(Private2, private_2, PF_ANY) +FOLIO_FLAG(private_2, FOLIO_HEAD_PAGE) /* owner_2 can be set on tail pages for anon memory */ FOLIO_FLAG(owner_2, FOLIO_HEAD_PAGE)