Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp623702ybz; Wed, 15 Apr 2020 15:21:17 -0700 (PDT) X-Google-Smtp-Source: APiQypL8BVsYN/cYm5O6D9/ZXRTtjqFDGiuNvGjlG7K0XLblzRBYUrUg+el5ulpW8VEENyC25NyO X-Received: by 2002:a17:906:6483:: with SMTP id e3mr6968462ejm.284.1586989277075; Wed, 15 Apr 2020 15:21:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586989277; cv=none; d=google.com; s=arc-20160816; b=BeGVsKC/UAbzWaCE1RRr1EAudfk1K/DpyrA3+s0+dQK9KidlWrXXlwC5lr1evhikJF s6tDdpuVZSGhSpaiwkxd/itzs/p7neC6rJL3+fx4j61j7oF2FmcFqpMXl/T18A3k3P4F LTJbKAfd8xU99RK+PhQL39g4XBqWWsUwLbxhTGZYxWrTza2CCdFS+BO3Li0p0MeGVY7S Vuc4TPHduQUfwBQUS8EczQlH0Uw63ZmVYmlk4C+LQ1Fmhh/YtCT2yNgwS5yGqEM6HqZS juWerPINs/f2s8AXwlj9EhEuAI57BHdiof+DI7nV9RHXz6bm0vemASjHpTXOwOe3Q0Wq Tu9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:ironport-sdr :ironport-sdr; bh=xNlyAWDgZasA8xSeb3THrONLcrOPIVhiA1mYvi5bZZE=; b=brfPsRZnuTvjzDLdmmPDXHW/UNE7DfO/aeVC8dqwkjMxv/oyGeyhkt72/Y5HNPinl/ zDbkcQi3VTHd2gybMbHF8IUyG15fjbeZmu9wkNXdPaaSCLGXPp6/dKP7ZIY/EcuPCpRW DGENQhi2PHdZf2vWzaP1e2wGY5ocj8FKdovudwMg33Ad4TgMjAJXKRkaAJducCDuKM6m PsIY9r2jY5ZZfqtYTSYOyaRzMhNEucbFcSuOm/lhUF0pb4QtqoDQSQxeJsDG9jwC5Gsw O6FTnVORb3TgN7fwON1YlYSG9yTF7g1Qk7BxCEW3gJnScCcZwVSkM82MrmuhIxwqbJp0 cU3A== 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 x27si8302233ejc.450.2020.04.15.15.20.53; Wed, 15 Apr 2020 15:21:17 -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 S2635264AbgDOHoc (ORCPT + 99 others); Wed, 15 Apr 2020 03:44:32 -0400 Received: from mga07.intel.com ([134.134.136.100]:35275 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2635245AbgDOHoM (ORCPT ); Wed, 15 Apr 2020 03:44:12 -0400 IronPort-SDR: 4Aht1Cit3gqBivU5pF6Jr3CMKVSvsv2blI2vMI4xYfedGOcdRp3FU7PNJLihdDXQTvImQS4Hca KDVM6hxMviEg== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Apr 2020 00:44:11 -0700 IronPort-SDR: xG888X2yA7QrY0sNtoht0u4esMcn2G+GOhx/16MnoB2aXnYmjAV3LwZ4oJU9DfgrThk0bRYSas Q1macOKatCgQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,386,1580803200"; d="scan'208";a="253447153" Received: from yhuang-dev.sh.intel.com (HELO yhuang-dev) ([10.239.159.23]) by orsmga003.jf.intel.com with ESMTP; 15 Apr 2020 00:44:09 -0700 From: "Huang\, Ying" To: Andrea Righi Cc: Andrew Morton , Minchan Kim , Anchal Agarwal , , Subject: Re: [PATCH v2] mm: swap: use fixed-size readahead during swapoff References: <20200413111810.GA801367@xps-13> <87a73f7d71.fsf@yhuang-dev.intel.com> <20200413133150.GA810380@xps-13> <87wo6i6efn.fsf@yhuang-dev.intel.com> <20200414130520.GF810380@xps-13> <87v9m1zd83.fsf@yhuang-dev.intel.com> <20200415073239.GG810380@xps-13> Date: Wed, 15 Apr 2020 15:44:08 +0800 In-Reply-To: <20200415073239.GG810380@xps-13> (Andrea Righi's message of "Wed, 15 Apr 2020 09:32:39 +0200") Message-ID: <87imi1yz07.fsf@yhuang-dev.intel.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=ascii Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Andrea Righi writes: > mm/swapfile.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/mm/swapfile.c b/mm/swapfile.c > index 9fd47e6f7a86..cb9eb517178d 100644 > --- a/mm/swapfile.c > +++ b/mm/swapfile.c > @@ -1944,7 +1944,9 @@ static int unuse_pte_range(struct vm_area_struct *vma, pmd_t *pmd, > vmf.pmd = pmd; > last_ra = atomic_read(&last_readahead_pages); > atomic_set(&swapin_readahead_hits, last_ra); You need to remove the above 2 lines firstly. Best Regards, Huang, Ying > - page = swapin_readahead(entry, GFP_HIGHUSER_MOVABLE, &vmf); > + page = lookup_swap_cache(entry, vma, addr); > + if (!page) > + page = swapin_readahead(entry, GFP_HIGHUSER_MOVABLE, &vmf); > if (!page) { > if (*swap_map == 0 || *swap_map == SWAP_MAP_BAD) > goto try_next; > > Thanks! > -Andrea