From patchwork Tue Aug 10 20:29:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Shi X-Patchwork-Id: 12429419 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=-13.5 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT 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 83988C4338F for ; Tue, 10 Aug 2021 20:29:42 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 2108661008 for ; Tue, 10 Aug 2021 20:29:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 2108661008 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 7FDDA8D0002; Tue, 10 Aug 2021 16:29:41 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7AE176B0072; Tue, 10 Aug 2021 16:29:41 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 69D0F8D0002; Tue, 10 Aug 2021 16:29:41 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0216.hostedemail.com [216.40.44.216]) by kanga.kvack.org (Postfix) with ESMTP id 50B356B0071 for ; Tue, 10 Aug 2021 16:29:41 -0400 (EDT) Received: from smtpin20.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id F2A738249980 for ; Tue, 10 Aug 2021 20:29:40 +0000 (UTC) X-FDA: 78460311720.20.3343EF4 Received: from mail-pj1-f50.google.com (mail-pj1-f50.google.com [209.85.216.50]) by imf17.hostedemail.com (Postfix) with ESMTP id BAC14F002C9D for ; Tue, 10 Aug 2021 20:29:40 +0000 (UTC) Received: by mail-pj1-f50.google.com with SMTP id a8so34782980pjk.4 for ; Tue, 10 Aug 2021 13:29:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=k9wsqN7YVW74vSpW7e/ejgv7USagZP+TqAT+Y6PYQHY=; b=uLhHC4BB4SdqtXeV4nk8oKb2M/EPPK+qS0dWpRp1kk8U+pDB1fzViuhbYBGl3IX04c gtPHvtptqrK6J1ZXgpQh9WH3ir8YRql+k03hsoNTHj1SEAw0C4/6pzKFAeWFP3b1r0GA P0Grgo6j3P7CmVX6kvog4SK9BjzJy0pEMl9TwdeWD3QHp+/kCX1L5kISAFr9zJxC/5xR ajGXf1Iuln/CQyv05+fsCUW35yL/LoLBG07ZDDRHsfjIduPCX9nHQk/USlk03l2caAnE zCjEzY7t7a3Q92c40EfqGSQTy1R+b/fSEiD8i1+J86gYA0ep0cGCCM99NM2RCdXtQgoq 1MwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=k9wsqN7YVW74vSpW7e/ejgv7USagZP+TqAT+Y6PYQHY=; b=eDslsBSlOjB+OSNeZzRImJsZj24Zerf/ZAQ/Jjje1f9b5nu+vZPA1h1lHdajDg1Em5 sDFehfzjD1TF8pDZOu4/ez91riNeKiKK059wpNhEgxURKIViU9u4FTS81+JKEzpY10WA chqDvryRddiKQt+iY/U3bEEnQsnAes7vnvJSi7KJ2ZXHjsFHichjYqyShK88h1Ds8ZSr EHzf5bn86lnVkMPifuB8ViFzvB3sJrzK6lq6GwRE5w7vVRfVYxqheFE7vVcItefx+HsC BVtM6A8dyhME/OgB7i2sAI7+PFWgmyysZfyr7x9MMFdg7kHziNYrlUxxSDeeD0gtNih/ pMwA== X-Gm-Message-State: AOAM5318WdT/9HcGUJY35HSu3JpEfDb2/usyf8geFS0r6oP6Kuu4iwtS DbiyLBMDpu2v2WTt3UEfQWs= X-Google-Smtp-Source: ABdhPJwRkFSelQQu1jRuLdTr7MZ+iU84dCdmsYiR/77wsHUICwrhjerxSHAZmBvF1ZtDjbvnPqX6lw== X-Received: by 2002:aa7:9254:0:b029:3c9:268e:ae68 with SMTP id 20-20020aa792540000b02903c9268eae68mr19345505pfp.58.1628627379720; Tue, 10 Aug 2021 13:29:39 -0700 (PDT) Received: from localhost.localdomain (c-73-93-239-127.hsd1.ca.comcast.net. [73.93.239.127]) by smtp.gmail.com with ESMTPSA id e12sm24697145pfc.214.2021.08.10.13.29.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Aug 2021 13:29:38 -0700 (PDT) From: Yang Shi To: hughd@google.com, ying.huang@intel.com, linmiaohe@huawei.com, Andrew Morton Cc: shy828301@gmail.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/3 linux-next] Revert "mm,shmem: fix a typo in shmem_swapin_page()" Date: Tue, 10 Aug 2021 13:29:34 -0700 Message-Id: <20210810202936.2672-1-shy828301@gmail.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: BAC14F002C9D Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=uLhHC4BB; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf17.hostedemail.com: domain of shy828301@gmail.com designates 209.85.216.50 as permitted sender) smtp.mailfrom=shy828301@gmail.com X-Stat-Signature: xuoaq6ftgj83ytzwrnino6ptsfp3a17m X-HE-Tag: 1628627380-589333 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: 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"), so the fix commit and this fix's fix commit could be reverted as well. Suggested-by: Hugh Dickins Cc: "Huang, Ying" Cc: Miaohe Lin Signed-off-by: Yang Shi --- This revert is for linux-next/-mm tree only since this commit has not merged into Linus's tree yet. mm/shmem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/shmem.c b/mm/shmem.c index 1bea7f50825b..dcc07d14162e 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -1711,7 +1711,7 @@ static int shmem_swapin_page(struct inode *inode, pgoff_t index, /* Prevent swapoff from happening to us. */ si = get_swap_device(swap); if (!si) { - error = -EINVAL; + error = EINVAL; goto failed; } /* Look it up and read it in.. */ From patchwork Tue Aug 10 20:29:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Shi X-Patchwork-Id: 12429421 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=-13.5 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT 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 3E93BC432BE for ; Tue, 10 Aug 2021 20:29:44 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id CC011604AC for ; Tue, 10 Aug 2021 20:29:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org CC011604AC Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 53F006B0071; Tue, 10 Aug 2021 16:29:43 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4F0938D0003; Tue, 10 Aug 2021 16:29:43 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 38FCE6B0073; Tue, 10 Aug 2021 16:29:43 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0028.hostedemail.com [216.40.44.28]) by kanga.kvack.org (Postfix) with ESMTP id 1F7E66B0071 for ; Tue, 10 Aug 2021 16:29:43 -0400 (EDT) Received: from smtpin06.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id C9C071B667 for ; Tue, 10 Aug 2021 20:29:42 +0000 (UTC) X-FDA: 78460311804.06.0113285 Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) by imf04.hostedemail.com (Postfix) with ESMTP id 8DC2B5001B4E for ; Tue, 10 Aug 2021 20:29:42 +0000 (UTC) Received: by mail-pl1-f171.google.com with SMTP id d17so22889372plr.12 for ; Tue, 10 Aug 2021 13:29:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=g/pTJfigSCEh5kckZ70NaOFpwcYGnuFXZ4+14JoNPQc=; b=dgoxXGQqN4xU6YEPuThXK7v1DTae92iDRcALKgKvLO2p9wvXc8Gby6jXL9xrh8aXpl y+y77nHdKJy4yAOH1UFqMvuh4g9O+NHr4Ht99XWVyBt5f0fwwn6+hZ7jLPbljT3RgYhL tQUHdnnitxR33DRP87VLkRlI0Lp0a2N27Hmz199C9flOLfYc9sAMJpDKzpvthCaLI6ea NEjRwLAqOM76XT/HP8MwrM4IfhXwhfmGBR3b4wSo/RsLaZZDw/2cXUzy1webG25+GVTP 8i8tmmlJyoQh0tyB5xBMrZ/gKNn7dpb9uENpx9XDvjaq2UZsGy7jP9wBgwzI34kvqQ5a n4eg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=g/pTJfigSCEh5kckZ70NaOFpwcYGnuFXZ4+14JoNPQc=; b=XlhNN6doMSHUzGlB+iEfuw0cRE6V3wJe/hcraCtrusUDD5VsHzhBG+vLwNQtWlD5+2 TE2O9ZUmxY0w6tALtBMg+jR+a/4sxDzsVC9u8srbPd2ZVdlhnFTL9x6Rh9cf/UGCmeiQ yvZIjYU1whK4FbK9HVCJ6ggoEs5SjaqeIqIsm3r6n7LJbfpOTxqgcP3SNqzTi+nxgk1f LYnhL1oXsIzAWBo5tdSqQTx+Wtdr3wvYrqXM/bsR+Eo/aj87W4QWmdGkqWvhheNkGEJH aSg2Pmh8ypdiAcmZFAaNevZoOUJDJmjwq2wcKswnVyAySs9uw6roK6TSAAh3yoB9c3Pr Ty9g== X-Gm-Message-State: AOAM533qTj+ZEzNLKTlhJPrFTUcgqh5cHbq/BmLEvdspQquSsm+hdUWq ar4rY3Y1QD2QygBERPvehLM= X-Google-Smtp-Source: ABdhPJw3R1cjaI6hRD7+jh7X4bu72Tk12gIFPbsf9htD7SeLAXnKzFekOLSN1lT9i7SmvtzvLMUGlA== X-Received: by 2002:a62:87c5:0:b029:3b5:f90f:c2eb with SMTP id i188-20020a6287c50000b02903b5f90fc2ebmr31281252pfe.28.1628627381588; Tue, 10 Aug 2021 13:29:41 -0700 (PDT) Received: from localhost.localdomain (c-73-93-239-127.hsd1.ca.comcast.net. [73.93.239.127]) by smtp.gmail.com with ESMTPSA id e12sm24697145pfc.214.2021.08.10.13.29.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Aug 2021 13:29:40 -0700 (PDT) From: Yang Shi To: hughd@google.com, ying.huang@intel.com, linmiaohe@huawei.com, Andrew Morton Cc: shy828301@gmail.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/3] Revert "mm/shmem: fix shmem_swapin() race with swapoff" Date: Tue, 10 Aug 2021 13:29:35 -0700 Message-Id: <20210810202936.2672-2-shy828301@gmail.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210810202936.2672-1-shy828301@gmail.com> References: <20210810202936.2672-1-shy828301@gmail.com> MIME-Version: 1.0 X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 8DC2B5001B4E Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=dgoxXGQq; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf04.hostedemail.com: domain of shy828301@gmail.com designates 209.85.214.171 as permitted sender) smtp.mailfrom=shy828301@gmail.com X-Stat-Signature: shucti4k7uqt8wqcwwmy8e49amt4g47g X-HE-Tag: 1628627382-170246 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: 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"), so the fix commit could be just reverted as well. Suggested-by: Hugh Dickins Cc: "Huang, Ying" Cc: Miaohe Lin Signed-off-by: Yang Shi --- mm/shmem.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/mm/shmem.c b/mm/shmem.c index dcc07d14162e..d5427de5bf02 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -1699,8 +1699,7 @@ static int shmem_swapin_page(struct inode *inode, pgoff_t index, struct address_space *mapping = inode->i_mapping; struct shmem_inode_info *info = SHMEM_I(inode); struct mm_struct *charge_mm = vma ? vma->vm_mm : NULL; - struct swap_info_struct *si; - struct page *page = NULL; + struct page *page; swp_entry_t swap; int error; @@ -1708,12 +1707,6 @@ static int shmem_swapin_page(struct inode *inode, pgoff_t index, swap = radix_to_swp_entry(*pagep); *pagep = NULL; - /* Prevent swapoff from happening to us. */ - si = get_swap_device(swap); - if (!si) { - error = EINVAL; - goto failed; - } /* Look it up and read it in.. */ page = lookup_swap_cache(swap, NULL, 0); if (!page) { @@ -1775,8 +1768,6 @@ static int shmem_swapin_page(struct inode *inode, pgoff_t index, swap_free(swap); *pagep = page; - if (si) - put_swap_device(si); return 0; failed: if (!shmem_confirm_swap(mapping, index, swap)) @@ -1787,9 +1778,6 @@ static int shmem_swapin_page(struct inode *inode, pgoff_t index, put_page(page); } - if (si) - put_swap_device(si); - return error; } From patchwork Tue Aug 10 20:29:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Shi X-Patchwork-Id: 12429423 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=-13.5 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT 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 EF688C43214 for ; Tue, 10 Aug 2021 20:29:45 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 95EAB60F13 for ; Tue, 10 Aug 2021 20:29:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 95EAB60F13 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 1BDD88D0005; Tue, 10 Aug 2021 16:29:45 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 146E48D0003; Tue, 10 Aug 2021 16:29:45 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F038A8D0005; Tue, 10 Aug 2021 16:29:44 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0120.hostedemail.com [216.40.44.120]) by kanga.kvack.org (Postfix) with ESMTP id D0CBD8D0003 for ; Tue, 10 Aug 2021 16:29:44 -0400 (EDT) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 7F306182D5C84 for ; Tue, 10 Aug 2021 20:29:44 +0000 (UTC) X-FDA: 78460311888.19.1CF4319 Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180]) by imf11.hostedemail.com (Postfix) with ESMTP id 3B258F003FCB for ; Tue, 10 Aug 2021 20:29:44 +0000 (UTC) Received: by mail-pl1-f180.google.com with SMTP id f3so12285696plg.3 for ; Tue, 10 Aug 2021 13:29:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=hZjOsueYpGQZhP7Bl+kpLTfQ5nGKWlyBAih7CetRBqo=; b=d27jbU5RObYQHtJTomYK15bAtbSLjYnuuQGarNydT4VQfGjI3fgRutZKx9f9jnFgZF XdyptNt76rJ9ZDeUXc93+a+9ULz6cwZaJP7mqbiwyhRztgT2voZK8ZesrQxSEaWvhNVp Nt26APxgTiBvC3UogJ4qu3swuHbFNuQ6MSQiS8R6S0STbxDpN7o2ZxjAv/p5aEDY7zN3 /Ahn/SVMsrbmC04xT6dyAZJs0RcjIfYG00VI5iRObuZwKJU6itBqmlPX5YKjuVzbeg3M uXlRpbtBhUhaPrE8i+i1w48acx8Ncvc9zR+h5mxZ+IKZmuJ029grf5jaipsfEv8mSxtJ tVdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=hZjOsueYpGQZhP7Bl+kpLTfQ5nGKWlyBAih7CetRBqo=; b=VRrNJVVfC1dkLc5ooDubIvfELJvPk8txRhkVrOwkcfsTMleUTvnGshX5FG6+3KmdPT mMjjuqxZ/hIoaCckHfC4ZOn8opulSkFPZrGDCBjr024Co8ggC6XpGWi0SGuxOGP6ZEB3 L0/0xVuQBe4uzEmcXAuxXuSaD2AcdQfH6HD2E+kBEEQhd0bYNyOmKVTmWRsXmng4IcVC sz7eXIh6/R7Ch0YiWWlKRjrGOXXDcsMtTaghZcNXLED4d+2YfahLdIU3SZZwpUjF+4j6 JjFWIdtvMugdZr9v+VZdTdBjMnfMylA3kq41JrmBVrafS6M6wTJGikNfMAYrCqKxwkPX YNlg== X-Gm-Message-State: AOAM530fk6nGP/OBu4ybMxpTFXu1A67+fVL4ASTG/nROf4Eo15/EiAXy 60EhjJPhi8a6NuTU2LE5gDY= X-Google-Smtp-Source: ABdhPJwxeNtymkuQhLsqn6aJPUCztLEhhXqt/9LBl9cBwT9fLTENQbvFeFkGhVctnCs6SIZMzlNn1w== X-Received: by 2002:a62:e40d:0:b029:3ab:42cd:d156 with SMTP id r13-20020a62e40d0000b02903ab42cdd156mr24870896pfh.81.1628627383473; Tue, 10 Aug 2021 13:29:43 -0700 (PDT) Received: from localhost.localdomain (c-73-93-239-127.hsd1.ca.comcast.net. [73.93.239.127]) by smtp.gmail.com with ESMTPSA id e12sm24697145pfc.214.2021.08.10.13.29.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Aug 2021 13:29:42 -0700 (PDT) From: Yang Shi To: hughd@google.com, ying.huang@intel.com, linmiaohe@huawei.com, Andrew Morton Cc: shy828301@gmail.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/3] Revert "mm: swap: check if swap backing device is congested or not" Date: Tue, 10 Aug 2021 13:29:36 -0700 Message-Id: <20210810202936.2672-3-shy828301@gmail.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210810202936.2672-1-shy828301@gmail.com> References: <20210810202936.2672-1-shy828301@gmail.com> MIME-Version: 1.0 Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=d27jbU5R; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf11.hostedemail.com: domain of shy828301@gmail.com designates 209.85.214.180 as permitted sender) smtp.mailfrom=shy828301@gmail.com X-Stat-Signature: affacip8gdp4uf8cg9fpexdwcm78n1yh X-Rspamd-Queue-Id: 3B258F003FCB X-Rspamd-Server: rspam01 X-HE-Tag: 1628627384-314878 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: 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. Suggested-by: Hugh Dickins Cc: "Huang, Ying" Cc: Miaohe Lin Signed-off-by: Yang Shi Acked-by: Hugh Dickins --- mm/swap_state.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/mm/swap_state.c b/mm/swap_state.c index 1a29b4f98208..8d4104242100 100644 --- a/mm/swap_state.c +++ b/mm/swap_state.c @@ -628,13 +628,6 @@ struct page *swap_cluster_readahead(swp_entry_t entry, gfp_t gfp_mask, 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;