Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp5830909imd; Wed, 31 Oct 2018 02:44:35 -0700 (PDT) X-Google-Smtp-Source: AJdET5dzLwvKVcm88NVCgaceHlk1S1WSwR9a6CDDA6HX84iEIICSKL5ADW88xn6AjFXszPQzm7Ar X-Received: by 2002:a17:902:c85:: with SMTP id 5-v6mr2532974plt.42.1540979075716; Wed, 31 Oct 2018 02:44:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540979075; cv=none; d=google.com; s=arc-20160816; b=hjKWO7CERps97BM8Csl0y4pzqT6rFe49C3KCnFrqDHwHrotckm/eP6SnmNiuMi3cdh qRoh/nFEB2tBMf14qyIQB9M7LJXcuzvF4Z2gtnpeALR5Emz/2IsCUlPdpYf2NoaK2zcr 5V4OD3LUzYeB/gs+gZCIprhdkPd7hA5Lb9Aj9M5fZmXNPLT3lQC4PPj+8cFILG3B54/B UdX5R8HZ76zHSoi+FFeIw8I/K+02eL3V+rM4N39v+zGLHQx04u8bfetxpBrrbn4gS5Jr X8vZvbxziUwZl68nfDFRXHyNEp4gyjWAqnFS3JAX2VFtESXeOr2RJ6AGblRfI1WGxN9T xGfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:subject:user-agent:message-id :references:cc:in-reply-to:from:to:content-transfer-encoding :mime-version; bh=+04zYxRWX82oX73uMvtDUdQyrTu0Wb8TZT69qcDhfHk=; b=r9Ua2bgyprlQ8x/xT0wfpgMIn2LhAWLGZYXZskNV5U+wgVjQSSzQ3w/Ku5RjaqSIMm fwo+sYUnanhK19a1Cw7XPty5G8EztBep8HF5XB64DbLEjjcbrMtfqPp3rYOQYe8bEfRT 5gYvY1vy4ZRGD2ixPqnYxgCfbr9IO5/71Y0wS9Zi/yN/VqUFWz1O+Sq6VWiDfzh+/NHS UEwlqCJaCVHPjB+goBLkhG35DInrfS7yf8y5tj+5fxDqIQTd19PsV0hNK2Mwr1ZmWt9O xIiCZgLHwl0O6MbAdrQtfGFAd9q1c0qFJJlESkJtTyYaSZzjHITw/WUbjIreYdorZZvH wDOw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 144si979695pga.322.2018.10.31.02.44.20; Wed, 31 Oct 2018 02:44:35 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727760AbeJaSkE convert rfc822-to-8bit (ORCPT + 99 others); Wed, 31 Oct 2018 14:40:04 -0400 Received: from mail.fireflyinternet.com ([109.228.58.192]:63556 "EHLO fireflyinternet.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727436AbeJaSkD (ORCPT ); Wed, 31 Oct 2018 14:40:03 -0400 X-Default-Received-SPF: pass (skip=forwardok (res=PASS)) x-ip-name=78.156.65.138; Received: from localhost (unverified [78.156.65.138]) by fireflyinternet.com (Firefly Internet (M1)) with ESMTP (TLS) id 14296867-1500050 for multiple; Wed, 31 Oct 2018 09:41:55 +0000 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8BIT To: Kuo-Hsin Yang , intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org From: Chris Wilson In-Reply-To: <20181031081945.207709-1-vovoy@chromium.org> Cc: Kuo-Hsin Yang , Michal Hocko , Joonas Lahtinen , Peter Zijlstra , Andrew Morton , Dave Hansen References: <20181031081945.207709-1-vovoy@chromium.org> Message-ID: <154097891543.4007.9898414288875202246@skylake-alporthouse-com> User-Agent: alot/0.6 Subject: Re: [PATCH v3] mm, drm/i915: mark pinned shmemfs pages as unevictable Date: Wed, 31 Oct 2018 09:41:55 +0000 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Kuo-Hsin Yang (2018-10-31 08:19:45) > The i915 driver uses shmemfs to allocate backing storage for gem > objects. These shmemfs pages can be pinned (increased ref count) by > shmem_read_mapping_page_gfp(). When a lot of pages are pinned, vmscan > wastes a lot of time scanning these pinned pages. In some extreme case, > all pages in the inactive anon lru are pinned, and only the inactive > anon lru is scanned due to inactive_ratio, the system cannot swap and > invokes the oom-killer. Mark these pinned pages as unevictable to speed > up vmscan. > > Add check_move_lru_page() to move page to appropriate lru list. > > This patch was inspired by Chris Wilson's change [1]. > > [1]: https://patchwork.kernel.org/patch/9768741/ > > Cc: Chris Wilson > Cc: Michal Hocko > Cc: Joonas Lahtinen > Cc: Peter Zijlstra > Cc: Andrew Morton > Cc: Dave Hansen > Signed-off-by: Kuo-Hsin Yang > --- > The previous mapping_set_unevictable patch is worse on gem_syslatency > because it defers to vmscan to move these pages to the unevictable list > and the test measures latency to allocate 2MiB pages. This performance > impact can be solved by explicit moving pages to the unevictable list in > the i915 function. > > Chris, can you help to run the "igt/benchmarks/gem_syslatency -t 120 -b -m" > test with this patch on your testing machine? I tried to run the test on > a Celeron N4000, 4GB Ram machine. The mean value with this patch is > similar to that with the mlock patch. Will do. As you are confident, I'll try a few different machines. :) -Chris