Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp539459imu; Mon, 5 Nov 2018 05:08:06 -0800 (PST) X-Google-Smtp-Source: AJdET5d18QTL9MS2/YvYz/vm2kkKdQcS8Km3n5LsFg/shAE1Mk/icvQ2SmpbLlofjZaXAaj4EiF5 X-Received: by 2002:a17:902:650a:: with SMTP id b10-v6mr21774109plk.36.1541423286042; Mon, 05 Nov 2018 05:08:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541423286; cv=none; d=google.com; s=arc-20160816; b=odRQb+Ca9h/9Zbde0eT/EwUptWlhLt0tAZAdoSwcGSSKZkXBWOZd7MFQvTNAWTbdSy VbSm9agrrnk+MDOTeJwFIb9EG7FI5GVeIc4qE4l4Ng8Sw3L0kyHxo0sXcsJ547eupPi6 oJ6qrxFKv83H8EmStr7ofNfxMoRXKrMK0sz5GmMKO00V3YgAJntZh+2HQoYLg7Td3Elt C3QiRdUNp2WIg1k9o3IbGrGk9tT02bzCLpX3WqcdEGsoMhiuKtjj3K1x9G6aDiaEAs16 YZWuOPPu/hkhNhjpldIMbo2jLMLgD/EQ++kw6fAD4RwJPjLZuE7yMCdx1tvrWJ5ce4v9 h8zg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=F3PVfAbBm6nGv5fj3SbnF7Ze9m8clDkQvVzQPZmNPJA=; b=lha5aemEqAlXmAGpWNHgp1MLU++OnrpBvEX+/7kd/mVFw/BRq3yrzK7Lq5HEE9QeSG T6qhwkmwW2oMB+td6kYTh2ICQwf52sR3h43u1QsSLS734+V4k6d4A0kKAFT21x9b6LDo WcgqmFZOYAk6rdUBDbvujX4hkXXYC60EKL4JFP8tsGFdj07kOSXAonU1LLzBmBLR+1lq QXH1BvUuhHTu1oAtqxGjWRINe+o4MjxMsIrqa8FOkUXRTXamnm+Lhdrn1lYIQOjpYXGW aTGS4MOQxTyLpOphmKuSWbNzD8E7nAB9kqROZSaAL1Le+aBpLCDq0zK9I4W4IUDIZA8U 3DHw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r29si14610727pga.477.2018.11.05.05.07.42; Mon, 05 Nov 2018 05:08:06 -0800 (PST) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729717AbeKEWZZ (ORCPT + 99 others); Mon, 5 Nov 2018 17:25:25 -0500 Received: from mx2.suse.de ([195.135.220.15]:43662 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728870AbeKEWZZ (ORCPT ); Mon, 5 Nov 2018 17:25:25 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 785A9ADED; Mon, 5 Nov 2018 13:05:44 +0000 (UTC) Date: Mon, 5 Nov 2018 14:05:44 +0100 From: Michal Hocko To: Kuo-Hsin Yang Cc: linux-kernel@vger.kernel.org, intel-gfx@lists.freedesktop.org, linux-mm@kvack.org, Chris Wilson , Joonas Lahtinen , Peter Zijlstra , Andrew Morton , Dave Hansen Subject: Re: [PATCH v4] mm, drm/i915: mark pinned shmemfs pages as unevictable Message-ID: <20181105130544.GJ4361@dhcp22.suse.cz> References: <20181105111348.182492-1-vovoy@chromium.org> <20181105130209.GI4361@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181105130209.GI4361@dhcp22.suse.cz> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon 05-11-18 14:02:09, Michal Hocko wrote: > On Mon 05-11-18 19:13:48, Kuo-Hsin Yang wrote: > > 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. > > > > Export pagevec API check_move_unevictable_pages(). > > Thanks for reworking the patch. This looks much more to my taste. At > least the mm part. I haven't really looked at the the drm part. One side note. Longterm we probably want a better pinning API. It would hide this LRU manipulation implementation detail + enforce some limiting and provide a good way that the pin is longterm. People are working on this already but it is a PITA and long time to get there. -- Michal Hocko SUSE Labs