Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp5524032imm; Tue, 16 Oct 2018 11:34:06 -0700 (PDT) X-Google-Smtp-Source: ACcGV61SG6sl1ncsrehtgN2H5LdBrS2DziQ7vJ3mA07trqEzfBTE+6SpkyZ2vGeTNkJ46qNiurFG X-Received: by 2002:a62:968a:: with SMTP id s10-v6mr23013015pfk.191.1539714846932; Tue, 16 Oct 2018 11:34:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539714846; cv=none; d=google.com; s=arc-20160816; b=Ff+gePNsxkB937I2LOArlks/nr8/9tnsQ5MziszPCOQtHy4g/yynH4FSqaMRZV2FHs gvF3Hu9nPmKEsBrvZShBlPDr0nWZyBzB1tGwF/rxVWYd0qqOMnspSCvldzhISmMGcX5G gmGy4UdEvq7HRmuMLikx64n496Klh+QkJASf8akFtp8VxB1oQQOGqwjpT0H5zRw6Tp2g Mu2+V05U098IvdFeEjKIyHMYSo7aDKLpqviQw4yJCR+NR8oouTFY+c4N4lqDGDkaaITn hStRT+Uda9aZMOODIjbTt5xyT84Cp6ZvBQBT/omlMcq2Gvtwpf7FgEsCNtLeqYnNF42a IJ3g== 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=GrWqgi8uqWooElcvQzx3qZ3jkzOHdKzSISNgwseNCno=; b=MuRe31clp/zIpUrLXKKGkd+syK1BZ27P8CeL+DiQGHUdSpwT7rh/Uu3AkPUa5UGRiw edwNfplxl1eUBlafgbM8F0sZcX5abFy+7yKLsLTKUOyfUhZ5D5DgLAud6i44g3Q4KXhw d4on0IS/Urk39MtzTKqrJGRTQujNHNAOcNKnuMwz9jUOd2WN2qYHqV4iiTptaLTOtN1e ViaN6svT3J0UNfvu9CmQBRsLtIvO9BknvWu9JxTQUPD8W/ojnIXXdYjQzfyuDV3/ot85 Nxv/EVyKLE6D06sOEfI1Swp62K007zEpOJGQXgBeFCx+NTqnhsjnlvNVtganTkQU6izd /DiQ== 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 t64-v6si15116289pfa.170.2018.10.16.11.33.50; Tue, 16 Oct 2018 11:34:06 -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 S1727192AbeJQCXp convert rfc822-to-8bit (ORCPT + 99 others); Tue, 16 Oct 2018 22:23:45 -0400 Received: from mail.fireflyinternet.com ([109.228.58.192]:58045 "EHLO fireflyinternet.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727006AbeJQCXp (ORCPT ); Tue, 16 Oct 2018 22:23:45 -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 14126165-1500050 for multiple; Tue, 16 Oct 2018 19:31:07 +0100 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8BIT To: Kuo-Hsin Yang , Michal Hocko From: Chris Wilson In-Reply-To: <20181016182155.GW18839@dhcp22.suse.cz> Cc: linux-kernel@vger.kernel.org, intel-gfx@lists.freedesktop.org, linux-mm@kvack.org, akpm@linux-foundation.org, peterz@infradead.org, dave.hansen@intel.com, corbet@lwn.net, hughd@google.com, joonas.lahtinen@linux.intel.com, marcheu@chromium.org, hoegsberg@chromium.org References: <20181016174300.197906-1-vovoy@chromium.org> <20181016174300.197906-3-vovoy@chromium.org> <20181016182155.GW18839@dhcp22.suse.cz> Message-ID: <153971466599.22931.16793398326492316920@skylake-alporthouse-com> User-Agent: alot/0.6 Subject: Re: [PATCH 2/2] drm/i915: Mark pinned shmemfs pages as unevictable Date: Tue, 16 Oct 2018 19:31:06 +0100 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Michal Hocko (2018-10-16 19:21:55) > On Wed 17-10-18 01:43:00, Kuo-Hsin Yang wrote: > > The i915 driver use 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. Mark these pinned > > pages as unevictable to speed up vmscan. > > I would squash the two patches into the single one. One more thing > though. One more thing to be careful about here. Unless I miss something > such a page is not migrateable so it shouldn't be allocated from a > movable zone. Does mapping_gfp_constraint contains __GFP_MOVABLE? If > yes, we want to drop it as well. Other than that the patch makes sense > with my very limited knowlege of the i915 code of course. They are not migrateable today. But we have proposed hooking up .migratepage and setting __GFP_MOVABLE which would then include unlocking the mapping at migrate time. Fwiw, the shmem_unlock_mapping() call feels quite expensive, almost nullifying the advantage gained from not walking the lists in reclaim. I'll have better numbers in a couple of days. -Chris