Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3070776ybt; Mon, 29 Jun 2020 14:31:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxeOZC6p/oDMrQd/3lkTbjjeNuyMmcaU957NGBdGb9LeilbHtGyhXpdGH0VV3/e9cARGFNr X-Received: by 2002:aa7:c655:: with SMTP id z21mr19811042edr.330.1593466293063; Mon, 29 Jun 2020 14:31:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593466293; cv=none; d=google.com; s=arc-20160816; b=xecyiii+uk9yR8/SXNgc16VucK83FenaicVNQqL9fcmuVvPB+b+GyAfaaG0oL/i9uq nkjXUfMKb25ne+tkNDqj3QfTBmqAjEWnDaPoNg1Aed68Q3NLfodWJNgLogTaQmSG4L6V rZkrn+kR1P6E+fiaK89xBAuVeG4OWDCWv9cGHpeTy3d7NCrD5iezZzfLZCNnVap114v9 Tw9PZc8PjNWUcZgYsSGsE8dx+/nVWfltujRXCnhBR5UDuRwRZRgxAl1pGnps6Fn5iNFy WfhWbTG7ilPawp+ieALd4/VmVcRMQ3jBf50QwhLr88MAeW1U97JRyL3CHq9Y8vlwMh0G 7O/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=knNEv9DVi1tv3B7Ooeqozj5gpTuJz0xpem7nZrCQ6BQ=; b=gN/F0f3GGIs8W7DVQIb1yqB/F87t8fXsxLQPXZyPp6Hha6trmQIb1sPF8a5tDF3fwg pZqoUjxAgJKb2JB6puBFHoiKUkdwrRcW5rQbE8Bw/lNysXcLZLtNtBj14iVJwdUJPHrr v7+YDwAi8b5DyElqYvZWJqEEahmenLXNMx4Mf0kV/mY6sHYEuAE7vgxfW/fq40Bw1KCD GVpk1hdAcIC4ecMMwCFHCFM92+d8iooInDO9ceQb6g4TWO4YYaDXGtn2FUtAY9DLzQvd 0zPgMhl9k9nCQ1QUidmmenjlyct3AWfhVNHb8pqY2pqd6Y4E7paEeHsPtDj6cjXUV/jo YyWQ== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a18si437831edn.607.2020.06.29.14.31.10; Mon, 29 Jun 2020 14:31:33 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729522AbgF2VaB (ORCPT + 99 others); Mon, 29 Jun 2020 17:30:01 -0400 Received: from mx2.suse.de ([195.135.220.15]:40462 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728888AbgF2SlY (ORCPT ); Mon, 29 Jun 2020 14:41:24 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 8266DAFAA; Mon, 29 Jun 2020 10:27:20 +0000 (UTC) Subject: Re: [PATCH for v5.8 3/3] mm/memory: fix IO cost for anonymous page To: js1304@gmail.com, Andrew Morton Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Johannes Weiner , Rik van Riel , Minchan Kim , Michal Hocko , kernel-team@lge.com, Joonsoo Kim References: <1592288204-27734-1-git-send-email-iamjoonsoo.kim@lge.com> <1592288204-27734-4-git-send-email-iamjoonsoo.kim@lge.com> From: Vlastimil Babka Message-ID: <882baec9-6d8e-55e9-ef67-67266458cbe0@suse.cz> Date: Mon, 29 Jun 2020 12:27:20 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: <1592288204-27734-4-git-send-email-iamjoonsoo.kim@lge.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/16/20 8:16 AM, js1304@gmail.com wrote: > From: Joonsoo Kim > > With synchronous IO swap device, swap-in is directly handled in fault > code. Since IO cost notation isn't added there, with synchronous IO swap > device, LRU balancing could be wrongly biased. Fix it to count it > in fault code. > > Signed-off-by: Joonsoo Kim Acked-by: Vlastimil Babka > --- > mm/memory.c | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/mm/memory.c b/mm/memory.c > index bc6a471..3359057 100644 > --- a/mm/memory.c > +++ b/mm/memory.c > @@ -3143,6 +3143,14 @@ vm_fault_t do_swap_page(struct vm_fault *vmf) > if (err) > goto out_page; > > + /* > + * XXX: Move to lru_cache_add() when it > + * supports new vs putback > + */ > + spin_lock_irq(&page_pgdat(page)->lru_lock); > + lru_note_cost_page(page); > + spin_unlock_irq(&page_pgdat(page)->lru_lock); > + > lru_cache_add(page); > swap_readpage(page, true); > } >