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 3D0ACC4338F for ; Mon, 9 Aug 2021 23:43:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0E76960E93 for ; Mon, 9 Aug 2021 23:43:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237066AbhHIXoN (ORCPT ); Mon, 9 Aug 2021 19:44:13 -0400 Received: from mga05.intel.com ([192.55.52.43]:31239 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232717AbhHIXoL (ORCPT ); Mon, 9 Aug 2021 19:44:11 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10070"; a="300392518" X-IronPort-AV: E=Sophos;i="5.84,308,1620716400"; d="scan'208";a="300392518" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga105.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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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