From patchwork Fri Aug 20 02:04:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 12448225 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 42026C4338F for ; Fri, 20 Aug 2021 02:04:12 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D4B1061056 for ; Fri, 20 Aug 2021 02:04:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org D4B1061056 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 7CF3B6B0071; Thu, 19 Aug 2021 22:04:11 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 77F3D900003; Thu, 19 Aug 2021 22:04:11 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 66DE56B0073; Thu, 19 Aug 2021 22:04:11 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0244.hostedemail.com [216.40.44.244]) by kanga.kvack.org (Postfix) with ESMTP id 49A3C6B0071 for ; Thu, 19 Aug 2021 22:04:11 -0400 (EDT) Received: from smtpin39.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id D73A32BA7E for ; Fri, 20 Aug 2021 02:04:10 +0000 (UTC) X-FDA: 78493813860.39.581A24E Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf04.hostedemail.com (Postfix) with ESMTP id 9580750000A6 for ; Fri, 20 Aug 2021 02:04:10 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 77F6D610FE; Fri, 20 Aug 2021 02:04:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1629425049; bh=v0VoGgFdcA4u75ps2l+O4sbayTrwRy1+gC9JbSq0H0w=; h=Date:From:To:Subject:In-Reply-To:From; b=cwK4EO3I2uaUqBDXdh8LCt2xrzXTcc4vKqwslA4IHNQqbNXe3n7pWgeQLsftJUqPq 7+3V7YZwew8WmQXvafufUqp0WlwGWYmuevkl/iD0jaMMCrjruE2J7ITBvUnyy33UxU e9duxHQI4kQOEaKcBA4O/Q2B3OjzewJuOp8FgBsY= Date: Thu, 19 Aug 2021 19:04:09 -0700 From: Andrew Morton To: akpm@linux-foundation.org, david@redhat.com, hannes@cmpxchg.org, hughd@google.com, iamjoonsoo.kim@lge.com, linmiaohe@huawei.com, linux-mm@kvack.org, mhocko@suse.com, minchan@kernel.org, mm-commits@vger.kernel.org, shy828301@gmail.com, torvalds@linux-foundation.org, willy@infradead.org, ying.huang@intel.com Subject: [patch 02/10] Revert "mm: swap: check if swap backing device is congested or not" Message-ID: <20210820020409.TZFRMik-6%akpm@linux-foundation.org> In-Reply-To: <20210819190327.14fc4e97102e1af7929e30af@linux-foundation.org> User-Agent: s-nail v14.8.16 Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=cwK4EO3I; dmarc=none; spf=pass (imf04.hostedemail.com: domain of akpm@linux-foundation.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org X-Stat-Signature: geczq1j4i1zqk41uoncpnftpyfzsyurp X-Rspamd-Queue-Id: 9580750000A6 X-Rspamd-Server: rspam01 X-HE-Tag: 1629425050-224200 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: From: Yang Shi Subject: Revert "mm: swap: check if swap backing device is congested or not" Due to the change about how block layer detects congestion the justification of commit 8fd2e0b505d1 ("mm: swap: check if swap backing device is congested or not") doesn't stand anymore, so the commit could be just reverted in order to solve the race reported by commit 2efa33fc7f6e ("mm/shmem: fix shmem_swapin() race with swapoff"). The fix was reverted by the previous patch. Link: https://lkml.kernel.org/r/20210810202936.2672-3-shy828301@gmail.com Signed-off-by: Yang Shi Suggested-by: Hugh Dickins Acked-by: Hugh Dickins Cc: "Huang, Ying" Cc: Miaohe Lin Cc: Matthew Wilcox (Oracle) Cc: Johannes Weiner Cc: Michal Hocko Cc: Joonsoo Kim Cc: Minchan Kim Cc: David Hildenbrand Signed-off-by: Andrew Morton --- mm/swap_state.c | 7 ------- 1 file changed, 7 deletions(-) --- a/mm/swap_state.c~revert-mm-swap-check-if-swap-backing-device-is-congested-or-not +++ a/mm/swap_state.c @@ -628,13 +628,6 @@ struct page *swap_cluster_readahead(swp_ if (!mask) goto skip; - /* Test swap type to make sure the dereference is safe */ - if (likely(si->flags & (SWP_BLKDEV | SWP_FS_OPS))) { - struct inode *inode = si->swap_file->f_mapping->host; - if (inode_read_congested(inode)) - goto skip; - } - do_poll = false; /* Read a page_cluster sized and aligned cluster around offset. */ start_offset = offset & ~mask;