From mboxrd@z Thu Jan 1 00:00:00 1970 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=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no 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 3BB61C432BE for ; Mon, 9 Aug 2021 23:43:55 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id C5EF56101E for ; Mon, 9 Aug 2021 23:43:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org C5EF56101E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 2A0798D0001; Mon, 9 Aug 2021 19:43:54 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 250756B0072; Mon, 9 Aug 2021 19:43:54 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 118268D0001; Mon, 9 Aug 2021 19:43:54 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0073.hostedemail.com [216.40.44.73]) by kanga.kvack.org (Postfix) with ESMTP id E954C6B0071 for ; Mon, 9 Aug 2021 19:43:53 -0400 (EDT) Received: from smtpin30.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 81D91204C0 for ; Mon, 9 Aug 2021 23:43:53 +0000 (UTC) X-FDA: 78457172346.30.1235438 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by imf26.hostedemail.com (Postfix) with ESMTP id 5DB5620019EF for ; Mon, 9 Aug 2021 23:43:52 +0000 (UTC) X-IronPort-AV: E=McAfee;i="6200,9189,10070"; a="194395952" X-IronPort-AV: E=Sophos;i="5.84,308,1620716400"; d="scan'208";a="194395952" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Aug 2021 16:43:50 -0700 X-IronPort-AV: E=Sophos;i="5.84,308,1620716400"; d="scan'208";a="525563317" Received: from yhuang6-desk2.sh.intel.com (HELO yhuang6-desk2.ccr.corp.intel.com) ([10.239.159.119]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Aug 2021 16:43:47 -0700 From: "Huang, Ying" To: Yang Shi Cc: Hugh Dickins , Matthew Wilcox , Andrew Morton , David Hildenbrand , Linux MM , Linux Kernel Mailing List , Miaohe Lin , Johannes Weiner , Michal Hocko , Joonsoo Kim , Minchan Kim Subject: Re: [PATCH] mm,shmem: Fix a typo in shmem_swapin_page() References: <20210723080000.93953-1-ying.huang@intel.com> <24187e5e-069-9f3f-cefe-39ac70783753@google.com> <8735rr54i9.fsf@yhuang6-desk2.ccr.corp.intel.com> <704d597-443b-32f-84eb-524a58dd8ef@google.com> Date: Tue, 10 Aug 2021 07:43:46 +0800 In-Reply-To: (Yang Shi's message of "Mon, 9 Aug 2021 14:26:49 -0700") Message-ID: <87k0ku89ql.fsf@yhuang6-desk2.ccr.corp.intel.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=ascii Authentication-Results: imf26.hostedemail.com; dkim=none; spf=none (imf26.hostedemail.com: domain of ying.huang@intel.com has no SPF policy when checking 192.55.52.136) smtp.mailfrom=ying.huang@intel.com; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=intel.com (policy=none) X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 5DB5620019EF X-Stat-Signature: 3qdz8c4sj3581hcwbyewapfx84b5kft7 X-HE-Tag: 1628552632-679618 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: Yang Shi writes: > On Fri, Aug 6, 2021 at 1:37 PM Yang Shi wrote: >> >> On Thu, Aug 5, 2021 at 11:01 PM Hugh Dickins wrote: >> > >> > On Thu, 5 Aug 2021, Yang Shi wrote: >> > > On Tue, Aug 3, 2021 at 10:34 PM Hugh Dickins wrote: >> > > > >> > > > I've never seen the swapoff race claimed by Miaohe, and don't expect to; >> > > > but he's probably right, given the current code. I just dislike adding >> > > > unnecessary complexity, and siting it in the wrong place (mm/shmem.c). >> > > > >> > > > Yang, is it possible that 5.1 commit 8fd2e0b505d1 ("mm: swap: check if >> > > > swap backing device is congested or not") was actually developed and >> > > > measured on 4.1 or earlier, which still had blk_set_queue_congested()? >> > > >> > > I forgot the exact version, but definitely not 4.1 or earlier. Maybe >> > > 4.19 or earlier. I'm not familiar with how block layer detect >> > > congestion, if the logic was changed, hence the optimization doesn't >> > > stand anymore nowadays, I'm totally fine to remove it. >> > >> > You drove me back to look more closely. blk_set_queue_congested() >> > vanished from include/linux/blkdev.h in 4.2, but blk_set_congested() >> > appeared then in block/blk-core.c to replace it. blk_set_congested() >> > vanished (along with all references to "congested" in blk-core.c) in >> > 5.0, then your commit (most probably tested on 4.19) went into 5.1 - >> > just after it had become redundant! >> > >> > Thanks, yes, let's revert that and Miaohe's and Huang's, later on. >> >> It should be easier to revert Huang Ying's , then Miaohe's, then mine. > > Hi Ying, > > I just prepared the reverts since I need to revert yours and Miaohe's > in order to revert my problematic commit. If your original commit will be reverted, then mine and Miaohe's can be reverted from the race condition point of view. Although I still think it's better to call get/put_swap_device() in shmem_swapin_page(), that can be discussed with another patch. Best Regards, Huang, Ying