From patchwork Thu Mar 2 23:27:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luis Chamberlain X-Patchwork-Id: 13158048 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 E165CC7EE30 for ; Thu, 2 Mar 2023 23:28:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 088AE6B007E; Thu, 2 Mar 2023 18:28:08 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id EB36B6B0083; Thu, 2 Mar 2023 18:28:07 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C6C726B007E; Thu, 2 Mar 2023 18:28:07 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 82C036B007E for ; Thu, 2 Mar 2023 18:28:07 -0500 (EST) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 45E801410F7 for ; Thu, 2 Mar 2023 23:28:07 +0000 (UTC) X-FDA: 80525548614.10.C832270 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf15.hostedemail.com (Postfix) with ESMTP id 17C09A0008 for ; Thu, 2 Mar 2023 23:28:04 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b="A1T9i9l/"; spf=none (imf15.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=1677799685; 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=X3niQqWSDaRdijh0GPlKHY1yoysmmoQVBPzADYFTAAk=; b=7mkVtHz4GFEONTQFYpRMMiACzD8H6HXwoeFFEtd9Y5E+ibmbUJ6UuDWbQXy+/CnSxW1N6n 0FspytqPOixwhkhcyUf7fU9aXUVQXNZdjY2WGRFvDdrAxyCBUZqM9QwWhUYtMcOHPehCM+ IxVgQ0Ft7/lDlva0B08Lr4CiCmbkhFg= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b="A1T9i9l/"; spf=none (imf15.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=1677799685; a=rsa-sha256; cv=none; b=tAy1eIDlke0LtejVwOBCW7P3/WpTG0kA9oAV0V79MxgO6sDdA9MkHr4gQuKyxO12eKRNWq uL5ISSV9TY8KVyuVAX0sPW529fhEAOcWS+D2LE0GgnP8ml03Bviih/ZdlKdTEYBIB2YJqS IFuGrGyyhkv5BQyWPlKsTZIHmppOUiA= 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=X3niQqWSDaRdijh0GPlKHY1yoysmmoQVBPzADYFTAAk=; b=A1T9i9l/KhB0qQZfQ43uw6v8kl DTCTRWDp8ClUN+kK4tmCnmWxFQZNAu7/KlswhmxIBSNnubcoAF/0v32hcIh7vsx/2fYebdrGuOFfD cAnCJAhSbnS1joVOILJsNws5NnKu+5mYSq1Eg2EeWdf/r2/gWG/2PiHtkicrXr4nv4g8KNvqyd+h5 zSb4BZm/8ekQ3nBFaKCQSpzvzbNAJor5LMWh0xvyjEChMKRIwSW6QtvSbE5HH6mk+eiwxMNN1wRYL NN7yYd8Xgu8+6Yqm6vtCggq8UsMK7X8LuLapwpCc3bG7p2c7yZG4p+iTMZohqzaupylW/idKcbw0L a/8QUp7w==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1pXsL9-003j3I-3W; Thu, 02 Mar 2023 23:27:59 +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 Subject: [PATCH 1/6] shmem: remove check for folio lock on writepage() Date: Thu, 2 Mar 2023 15:27:53 -0800 Message-Id: <20230302232758.888157-2-mcgrof@kernel.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230302232758.888157-1-mcgrof@kernel.org> References: <20230302232758.888157-1-mcgrof@kernel.org> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam03 X-Stat-Signature: pzafe5c8zy5ixkjoe8ugpwymspdj4fsk X-Rspamd-Queue-Id: 17C09A0008 X-HE-Tag: 1677799684-543581 X-HE-Meta: U2FsdGVkX183XkJArBdEFP42Iy3qPvxZZ8RMDK8YnM+UlbVLQ0LHgWCxnBG08AtE1PyyvzmVGq6/6nFlVLGfKJFeNUrIQLyU5o85z1DeD+Q1kY3G+qjYmOqPhU+grfV6zFUWI/rNE/S3M6s5FfdJP2CY7cHnAlCwhvuXufVrPnB5259TsudH52zAsbN+HdmunLIpZOmjWY4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9uMC715PPkBF+t4o31kfKJz4IBfwN0uLnp6lxypWqEbpLrsGBxJgNQyRQt3kwGek866kHmgrTVuBVH+OwUTrPWrF5YcGn7zenWWKpHOR1qyuHfEsyTUNuCrrNMYTZah69mqKcTydT0cdtv1K9VccklHc8Pczt2yismzZlAgyGF5 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: 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 Signed-off-by: Luis Chamberlain Acked-by: David Hildenbrand --- 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;