Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp3247205pxt; Mon, 9 Aug 2021 21:58:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz65yimf6wF8FrY+XXWMIY8TO687BSmS8Yy0xhZ0t388GtwvEWA8qqHTS2msrdnN9xUPq3A X-Received: by 2002:a17:906:1412:: with SMTP id p18mr25613672ejc.545.1628571519985; Mon, 09 Aug 2021 21:58:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628571519; cv=none; d=google.com; s=arc-20160816; b=LshNaFTbL2evasXB0FMlraBGF9Ve+CeA/P2cnCFSDwCJIRR+SYXCPMkU4xHCLQliQq IyAd4MrQRwklE7N39ybCh/6QwwmM20+Xa4USPQx1NkJVZtxkPigAAjcNd5XOOzFXeZeM WkktJJwkDxBr8MoBJfsnqixSoauOQPBIEJHJ7dBzSZsEFbRyyHXCVoRSEQrBuuAAi/t8 HmdyUERS2t5pv78PTEG/Wwr53O7sDPDFrUmAMXBJ8bAFNnmGoK11qKKYhHCnGq5XysBa VKoS9tWTKlybUR+mCX1XVfJ4InpXHjLJ8GwinUZrwz6AXvJ7uRD5z3HYUY7k14jTibpk EiNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:message-id:in-reply-to :date:references:subject:cc:to:from; bh=siG+dtVvc4gWMHv9x0faZsRL/y9O5SOxql4bNY2wW/8=; b=bzilEf29L4KSYZGd/Qq3V0F2hwYDAmmzSe3AgwrtV6OpQJAzUuvqYX9f0j4r50IRRG GvBbNUhg3cHD3g0Dt9/j4NoA/uxue+qoTdyapnYh6Gi9oa5j7BdzCOcW4R6CKxd6Ep9S Ly0gYDxKmatRvn1upn758XFSGfwJKA/dFDmSfYfgtwKF5ycR4pk7+zr1Ypz8EfCW4dX+ X7L2zzb7Uz8QO+Nqmcu8+hFATozj48Avq864ILXoQKwdaSEiEmx+CPd8XpluiE9kVGsS tifLo/4orj8SOdFBxxvBmPtQSE/9I6dHSeeSuO14YABZv4pflzKY82XiCJmLc7XGQEnz h0lw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e4si16283994ejs.733.2021.08.09.21.58.05; Mon, 09 Aug 2021 21:58:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237059AbhHIXoM (ORCPT + 99 others); Mon, 9 Aug 2021 19:44:12 -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