From patchwork Thu Mar 9 23:05:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luis Chamberlain X-Patchwork-Id: 13168529 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 642EEC61DA4 for ; Thu, 9 Mar 2023 23:06:06 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6C0A3280007; Thu, 9 Mar 2023 18:06:00 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 67068280006; Thu, 9 Mar 2023 18:06:00 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 55F25280007; Thu, 9 Mar 2023 18:06:00 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 48D7B280006 for ; Thu, 9 Mar 2023 18:06:00 -0500 (EST) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 1337A1205FA for ; Thu, 9 Mar 2023 23:06:00 +0000 (UTC) X-FDA: 80550894480.22.2231BD2 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf18.hostedemail.com (Postfix) with ESMTP id 701FA1C0017 for ; Thu, 9 Mar 2023 23:05:58 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=3S7FD3TX; spf=none (imf18.hostedemail.com: domain of mcgrof@infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=mcgrof@infradead.org; dmarc=fail reason="No valid SPF, DKIM not aligned (relaxed)" header.from=kernel.org (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1678403158; h=from:from:sender: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=H478EBfRc8YOP2keWn4dK4BIB7gGzmccWr6qJ1Nxgx8=; b=agJf9++92Srqwq7AalHFk0cHPJZMG7qBrFG4fym3Uc8LeRwwwjHP6ZFF88hhhjZy4Y0ILS TBR7VCnyBa33Pkt9ye6tIprcMhT4SWrUCrxuYXUudSs+UZMnTJaJBK7GcXm4ikqc8pvqBo eVtuk0CR1dmf9gWD2T706HibKUVD0/0= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=3S7FD3TX; spf=none (imf18.hostedemail.com: domain of mcgrof@infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=mcgrof@infradead.org; dmarc=fail reason="No valid SPF, DKIM not aligned (relaxed)" header.from=kernel.org (policy=none) ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1678403158; a=rsa-sha256; cv=none; b=iYmrBIpxsCzwP0HXD1dk8z6OpZ7+g6bGrWUiwcKMmnxJCYKTWrtuFrnf/ffrbxE8avNVqo QcuBsimgr5ErUvuNEZnib0lEAtEWCzq7p5JSRoy0LVflOWiEoBpCb4czHiDC3tiF3HwJMO FtA1ngDm9vffkEJ2Qh8HyMrPSR1M3sE= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description; bh=H478EBfRc8YOP2keWn4dK4BIB7gGzmccWr6qJ1Nxgx8=; b=3S7FD3TXf9UwH4vZnN664p7upk YngkEO7ZO7iHs5EUB/KYcNJUo/BBNpSQIKzIX2veruPnCMScaqst8M6NFr920RF+Ka8GmIiv23fXF e+foHWC2ZT4xOTXoeG61Ldgxwl1krdl21xo/MYEYnmV491LOq4xx+g2ILjTCD4JWvm+gt/0lL8SzB 7Bm9YAxy2MY4dP5fTR9VKWl1wIcNDc+iMCjK0hDYqtGPmSX4QavVkCiT3qr4JIHo/0u50GiK8JKGd LgqymKO7cQtlBE5EemwB6Nd2OqE+Og8haRrr/W8LciuaFC6uSXoTtZsSZUNijvsMRv9frTHiLnack 9cLWBkwg==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1paPKW-00CIRO-3B; Thu, 09 Mar 2023 23:05:48 +0000 From: Luis Chamberlain To: hughd@google.com, akpm@linux-foundation.org, willy@infradead.org, brauner@kernel.org Cc: linux-mm@kvack.org, p.raghav@samsung.com, da.gomez@samsung.com, a.manzanares@samsung.com, dave@stgolabs.net, yosryahmed@google.com, keescook@chromium.org, mcgrof@kernel.org, patches@lists.linux.dev, linux-kernel@vger.kernel.org, David Hildenbrand Subject: [PATCH v2 1/6] shmem: remove check for folio lock on writepage() Date: Thu, 9 Mar 2023 15:05:40 -0800 Message-Id: <20230309230545.2930737-2-mcgrof@kernel.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230309230545.2930737-1-mcgrof@kernel.org> References: <20230309230545.2930737-1-mcgrof@kernel.org> MIME-Version: 1.0 X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 701FA1C0017 X-Rspam-User: X-Stat-Signature: mxi47reywif149uwq14fxk5xk49d9e9z X-HE-Tag: 1678403158-722245 X-HE-Meta: U2FsdGVkX1/Yqt1fiiAbExh78CxQsBjwU683evjC2W+ARBnLpbwSZbFEdQnapzg9fo0/syKh0TCMjp5hcdoCFgnQKlMBYujdNjkzniA+K+oTPt2E6PdxQ5IeHLfq2XbX6GQYjw9hQXYGODxNgDtRGlfve9aQGjx0kJfOmzUF0zBJ+bVJQBVN/Hc7FD35G6X0KwoazwNaf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8S7uLFvkWYEfj1+1q3KTKoOfL7J+mLJlJCUKnEAC31J6Ru+/J33HIdxGgQ6MhXS5azRIvzwlhXMNuUf858jUIatpw18jRy8RkmGE82rVGmsFshhMomnkemObZkza3dvZTJU6Qf3W5HEp9DHCO5NiqRH3+SD+kC6UDRSJwb+rHG69Bvf8EFMJBp8guAF3DuL0rcsulHTe8/b6EfCmFo6mrBSKsX5Kx4oE8z4KH+BKQ== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000006, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Matthew notes we should not need to check the folio lock on the writepage() callback so remove it. This sanity check has been lingering since linux-history days. We remove this as we tidy up the writepage() callback to make things a bit clearer. Suggested-by: Matthew Wilcox Acked-by: David Hildenbrand Reviewed-by: Christian Brauner Signed-off-by: Luis Chamberlain --- mm/shmem.c | 1 - 1 file changed, 1 deletion(-) diff --git a/mm/shmem.c b/mm/shmem.c index 1af85259b6fc..7fff1a3af092 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -1354,7 +1354,6 @@ static int shmem_writepage(struct page *page, struct writeback_control *wbc) folio_clear_dirty(folio); } - BUG_ON(!folio_test_locked(folio)); mapping = folio->mapping; index = folio->index; inode = mapping->host;