Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp783830imd; Thu, 1 Nov 2018 05:39:28 -0700 (PDT) X-Google-Smtp-Source: AJdET5eVz0sgkS2SrDu5lQ037iVGw4N8xHPzmHCQHT3x/mYEE8EX6/fUFn/y6WTkHXqYVmrwEdh8 X-Received: by 2002:a63:fb0b:: with SMTP id o11mr7038380pgh.211.1541075968017; Thu, 01 Nov 2018 05:39:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541075967; cv=none; d=google.com; s=arc-20160816; b=MaF2ZVzvUV88c1nW7iGcs5h2YM2AbxsTrFND5GfUT/ya4TQBwHLUtPEYp2mlZI0JdQ fSRdi1zeAUS8fU0594NncJ5CdGj+cHlRc2cr4gjp0sbtt22DFjtd7QUNOBUFe+tb/3CE LjBV6Ar1uCpPVowNEkZoHhLZE8qQ3p24nAAaxDYCJcjqRth+dh3evbG9fdfV5NgdIqOZ GBFfJXhfu+8jPEqZDj2f0+UHoyoEsXNqONxIpGdaUmyPDX3FPfW8WTr/eI/HE5uCjn6S yIPEeO7EF58kTXkIW95dIr1GIV1cHsJsA9tmeVdLLPDnw6G17qdrOg+bOhLb8gXoH4bL Tkqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=j6PF0RiTcJwkIcly71gREdGcceqUcI7V7FLfCAd/vnk=; b=dQt/y9T3PjUywyPW10NKPYAnew5eljco6X4jEbufjsFKENyuGZX3u3sIpLil5+xPhI f2bCbIPoG/sCbdT5lIVVdwPDF25CdNbbMOkzQOGVZVNfSL3u2CxmC74sLOpCsyQw5t9Y 5AeW/5bVmf9Y4nEkEJgK7wbgMnVguVSq7CrRbTfhLMUsne4gt9KqjVVFzAyjzKYSyASb xCK8I9APCj+uF6lmOOFI+XBkqLyNlUtQeJDYeJ/Eo8jfdBVd6uLZ5SFgykS+ef+VXB0g WXgRs4PdWG5uj4+zOOLUN2GhR4tXmT5Ezh86OOFpATY9KSVCaLvb4KgK0rjk+mev0fWZ aSUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=HzadiFe8; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l12-v6si19867271plc.54.2018.11.01.05.39.10; Thu, 01 Nov 2018 05:39:27 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=HzadiFe8; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728244AbeKAUbb (ORCPT + 99 others); Thu, 1 Nov 2018 16:31:31 -0400 Received: from mail-ot1-f65.google.com ([209.85.210.65]:40469 "EHLO mail-ot1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727976AbeKAUbb (ORCPT ); Thu, 1 Nov 2018 16:31:31 -0400 Received: by mail-ot1-f65.google.com with SMTP id m15so17417722otl.7 for ; Thu, 01 Nov 2018 04:28:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=j6PF0RiTcJwkIcly71gREdGcceqUcI7V7FLfCAd/vnk=; b=HzadiFe8GF1u9jwmpnGnmyHhyB6lXlryobbYWLasu/qlWD5Lr5KKRzC3Z/HzcXInCR 27kMxLDhrlnM0U0Vjek5jkoiBt49TIqvG0OYqYFWqxjYd3hToupHSAe0GTStTt4oXYY1 hp4X2FAQs7hm+XsNA59KGaSzxJVse7i8KWp+0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=j6PF0RiTcJwkIcly71gREdGcceqUcI7V7FLfCAd/vnk=; b=Z155A7qE59DS5oGl5Rs3nBylEx//xeM7Yl2h2I6CZLADB6EXVu8grkDKd2Yx608V2B d9oaXM8sVD/4NB9bcxw+Eh4zp45+3DPm+YFUVLoCyGU89165LIIiND7eeLE5k/9Zt/cV bbmEqNzKbwoQ1Wjy7xmA5rviUM6P/ACO2k0jQCpEqmwmUfIr0+Ol/t7dq482uEI5mEY9 WJaTdwqCUibSOuk6a9cZXXvKD9iAABbas2KN3psI9pYqKJXaozRE5hhaMurbYi9P2Al4 w0Ig12xaQ9ZWIhVn4icq8gfh5r9bTnvNPpEpjUijCZrN3GQSAux8e+woloctAGbpSA2k c2mw== X-Gm-Message-State: AGRZ1gKo4YzE+Fb3Qw1qIcCTwBHlrzy7PB7q8tnf3oqyl38ts+sS/MrC NrKpjYVQEDik7NltBOL4LQUUJhtnqphqk/u2qjS8 X-Received: by 2002:a9d:738a:: with SMTP id j10mr4455367otk.188.1541071737898; Thu, 01 Nov 2018 04:28:57 -0700 (PDT) MIME-Version: 1.0 References: <20181031081945.207709-1-vovoy@chromium.org> <20181031142458.GP32673@dhcp22.suse.cz> <20181031164231.GQ32673@dhcp22.suse.cz> In-Reply-To: <20181031164231.GQ32673@dhcp22.suse.cz> From: Vovo Yang Date: Thu, 1 Nov 2018 19:28:46 +0800 Message-ID: Subject: Re: [PATCH v3] mm, drm/i915: mark pinned shmemfs pages as unevictable To: mhocko@kernel.org Cc: dave.hansen@intel.com, linux-kernel@vger.kernel.org, intel-gfx@lists.freedesktop.org, linux-mm@kvack.org, Chris Wilson , Joonas Lahtinen , peterz@infradead.org, akpm@linux-foundation.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 1, 2018 at 12:42 AM Michal Hocko wrote: > On Wed 31-10-18 07:40:14, Dave Hansen wrote: > > Didn't we create the unevictable lists in the first place because > > scanning alone was observed to be so expensive in some scenarios? > > Yes, that is the case. I might just misunderstood the code I thought > those pages were already on the LRU when unevictable flag was set and > we would only move these pages to the unevictable list lazy during the > reclaim. If the flag is set at the time when the page is added to the > LRU then it should get to the proper LRU list right away. But then I do > not understand the test results from previous run at all. "gem_syslatency -t 120 -b -m" allocates a lot of anon pages, it consists of these looping threads: * ncpu threads to alloc i915 shmem buffers, these buffers are freed by i915 shrinker. * ncpu threads to mmap, write, munmap an 2 MiB mapping. * 1 thread to cat all files to /dev/null Without the unevictable patch, after rebooting and running "gem_syslatency -t 120 -b -m", I got these custom vmstat: pgsteal_kswapd_anon 29261 pgsteal_kswapd_file 1153696 pgsteal_direct_anon 255 pgsteal_direct_file 13050 pgscan_kswapd_anon 14524536 pgscan_kswapd_file 1488683 pgscan_direct_anon 1702448 pgscan_direct_file 25849 And meminfo shows large anon lru size during test. # cat /proc/meminfo | grep -i "active(" Active(anon): 377760 kB Inactive(anon): 3195392 kB Active(file): 19216 kB Inactive(file): 16044 kB With this patch, the custom vmstat after test: pgsteal_kswapd_anon 74962 pgsteal_kswapd_file 903588 pgsteal_direct_anon 4434 pgsteal_direct_file 14969 pgscan_kswapd_anon 2814791 pgscan_kswapd_file 1113676 pgscan_direct_anon 526766 pgscan_direct_file 32432 The anon pgscan count is reduced.