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,DKIM_INVALID, DKIM_SIGNED,FSL_HELO_FAKE,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 B38E5C4361B for ; Thu, 17 Dec 2020 21:02:40 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 16DD223A31 for ; Thu, 17 Dec 2020 21:02:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 16DD223A31 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 4B5B86B0036; Thu, 17 Dec 2020 16:02:39 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 46FF56B005D; Thu, 17 Dec 2020 16:02:39 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3550C6B0068; Thu, 17 Dec 2020 16:02:39 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0207.hostedemail.com [216.40.44.207]) by kanga.kvack.org (Postfix) with ESMTP id 1E5016B0036 for ; Thu, 17 Dec 2020 16:02:39 -0500 (EST) Received: from smtpin30.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id CD9FC8249980 for ; Thu, 17 Dec 2020 21:02:38 +0000 (UTC) X-FDA: 77603997996.30.nut45_470571927437 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin30.hostedemail.com (Postfix) with ESMTP id B37F8180B3C85 for ; Thu, 17 Dec 2020 21:02:38 +0000 (UTC) X-HE-Tag: nut45_470571927437 X-Filterd-Recvd-Size: 4305 Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) by imf06.hostedemail.com (Postfix) with ESMTP for ; Thu, 17 Dec 2020 21:02:38 +0000 (UTC) Received: by mail-pl1-f182.google.com with SMTP id t6so208491plq.1 for ; Thu, 17 Dec 2020 13:02:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=tgoap9L4iwubJMd62d013zJ/jUzO1FyiyUonhlbsWGk=; b=CDOirv8dwFQ8vlAVF/chnHD2OU7BBo59K7+qVUsIoTulhPCMPfj2bgf3YNnW2VaNn/ 11te1x2yrRyTvbhIY2TwdhfGsy6ZNtwjaDqM3n604PMCaii5slCWuLdyfcJoczZ2z0by 0Dgu7fXUmsOoZ9un3epHaYVV1pcxV/bUXlAL7rQYDmPVKsI01o03kBCWx/ynBbpRWKNp Japi9HXE0LnbaNEW50zp+xhOKwFkJJpiOmwKe+1bpm3+3ugUCC9QVlnimrHWwq7MCVVM dDXZVbUGpSVa5nTx4KiQ6aFmzj3H4K70nHxsBuzyivJ+wsCJ1q4L1YDxJJqHO4gtO+29 97YQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=tgoap9L4iwubJMd62d013zJ/jUzO1FyiyUonhlbsWGk=; b=Ub7/MaQOqx4bGorVIqWpk4G/28ez8nTFCWt1fQpNgu91HMy55YcrITlctGHb/xC9qc ePC/+aWgXo2JxyLG5IdtxOXfPhSHz2p0NfuVQNSWXcM2BvpeYzZyReHidQ5/XKWzk5a8 B4oR+PFvLwyFYCOEJSO2trYzofz9yu80U1ZO3KSV9JVojiWSEH/eDPtjlL/1Rw0YbL8X 87xRzAW7Bj5IllJ/pGGjvNRz2Nqj2Z86R7tTNd6k2CRGFnucgS5MxImWyA3WpgOzUi6G TFP9yza7y8KLC5hgv1xUOPubxrDKP/+VkOO7qujyNftVvFz/EOys1N07EBKOLibYMGRf KyOA== X-Gm-Message-State: AOAM533CdGJkDgwZEvtqSC8SpkbvdivJD42X0928U4nG4MjCRVrimkIL lHhxjlm/YBiVbOjrihY2JTc= X-Google-Smtp-Source: ABdhPJw8VsTOAD6m5kIT1eRxqHt8htu2Ag2Sobhkyn8FJU1wBgnq0q1wmQYlSkDM1s0N3jABjpFrIg== X-Received: by 2002:a17:90a:49c5:: with SMTP id l5mr1034563pjm.116.1608238956159; Thu, 17 Dec 2020 13:02:36 -0800 (PST) Received: from google.com ([2620:15c:211:201:7220:84ff:fe09:5e58]) by smtp.gmail.com with ESMTPSA id c24sm7100978pgi.71.2020.12.17.13.02.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Dec 2020 13:02:34 -0800 (PST) Date: Thu, 17 Dec 2020 13:02:32 -0800 From: Minchan Kim To: "Huang, Ying" Cc: Joonsoo Kim , Johannes Weiner , Vlastimil Babka , Hugh Dickins , Mel Gorman , Michal Hocko , Dan Williams , Christoph Hellwig , Ilya Dryomov , Andrew Morton , linux-mm Subject: Re: Do we still need skip swapcache logic in do_swap_page() for SWP_SYNCHRONOUS_IO? Message-ID: References: <87y2hxgpo7.fsf@yhuang-dev.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87y2hxgpo7.fsf@yhuang-dev.intel.com> 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: Hi Huang, On Thu, Dec 17, 2020 at 09:57:28AM +0800, Huang, Ying wrote: > Hi, Minchan, > > In commit 0bcac06f27d7 ("mm, swap: skip swapcache for swapin of > synchronous device"), swap cache management is skipped for super fast > device with synchronous IO. That did help performance for these devices > much at that time. But in commit aae466b0052e ("mm/swap: implement > workingset detection for anonymous LRU"), swap cache is used to record > workingset shadow value. So it needs to be operated anyway in swapin in > common cases. Although lockless operation get_shadow_from_swap_cache() > is used now, in swap_free() path, swap cache will be locked. So now, is > it still necessary to skip swap cache logic in do_swap_page() for > SWP_SYNCHRONOUS_IO? Maybe we can just simplify the logic? Since we have xarray and better swap management(I believe) since then, could you try to measure swap-in performance? If the gain is negligible today, we definitely could drop it. Thank you.