Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2190976imu; Tue, 6 Nov 2018 10:24:04 -0800 (PST) X-Google-Smtp-Source: AJdET5c6ZsutzdxVcNhH/IiMx78TnPBksXGIg6RnN/aa3YJrPoehxQAUxsSfe97Q3LFp4XweuwdP X-Received: by 2002:a62:35c2:: with SMTP id c185-v6mr27068282pfa.69.1541528644593; Tue, 06 Nov 2018 10:24:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541528644; cv=none; d=google.com; s=arc-20160816; b=BKzDQcCxsc/L+38rn2hmCdWQJV99UPczZdVO/vK0LEgc1yzBRgDSWJlzCwZOKqcIZi J/RI2pSRUWuuYMVH54r9IzdKY/tGXuO6uKBG+cb0Bkdq8HgLikLycVNzTpz1QwVdRJLu PfsTfmF91BGanDCs8GRm/xrURgIzPBDITo98ySdTsUdcd35NKk2cHH0be/wN+89xci5D 0I0ri4Ut0ddttnOaHvxRxd0AyxcpyNvC7+ua2JbFSxm/vVjxSknX+axXKYpMv4dw6AGx XqIZ8JeQrahE1Io2AdIewDtPUzGHw129V4O24mdin7TZj3JuId5NBBdi7r6m9/oqToPn RQ7A== 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:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=KBxJRUHtEEBVzHZQepMdqzcoeYuFyF61A4ofpNZqVfk=; b=shCP8I8yF7BjGU9oRw2Q5tkKu+Bash8/jtDOzK8d4bWuWCNEwAxu+V9CP2tqLd8zPx E+ZFP2//wnM2xK0nmbpvb08nht2NfyX2zDydPVLy9exRsnR7ubcQReXqgWLNC/GurjWd QUjxysqLo1m5hiop7Pf3Mt5ZKwOUPUSlN70KZh2GHxWbJA8HUdWmVniPWyNZtDhsxXew PCU8B/NIF/00xLpZVkl+A9zpMi0rt142YfIVREYJq1Tc0iZlPYCSCeuKpc3dVBr6xR+y g69aNTOhh0To1px1L3t1DCDbzhr2gtdh9v/neCETcRwCqZZjFxe6hcOynhocpFxC/rb1 llGA== 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 m39-v6si46557835plg.335.2018.11.06.10.23.49; Tue, 06 Nov 2018 10:24:04 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730944AbeKGDij (ORCPT + 99 others); Tue, 6 Nov 2018 22:38:39 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:39524 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730315AbeKGDij (ORCPT ); Tue, 6 Nov 2018 22:38:39 -0500 Received: from akpm3.svl.corp.google.com (unknown [104.133.8.65]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 273DC516; Tue, 6 Nov 2018 18:12:12 +0000 (UTC) Date: Tue, 6 Nov 2018 10:12:11 -0800 From: Andrew Morton To: Chris Wilson Cc: intel-gfx@lists.freedesktop.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Kuo-Hsin Yang , Joonas Lahtinen , Peter Zijlstra , Dave Hansen Subject: Re: [PATCH v7] mm, drm/i915: mark pinned shmemfs pages as unevictable Message-Id: <20181106101211.d2e4857aa36ea8ffbd870d2f@linux-foundation.org> In-Reply-To: <20181106132324.17390-1-chris@chris-wilson.co.uk> References: <20181106093100.71829-1-vovoy@chromium.org> <20181106132324.17390-1-chris@chris-wilson.co.uk> X-Mailer: Sylpheed 3.6.0 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 6 Nov 2018 13:23:24 +0000 Chris Wilson wrote: > From: Kuo-Hsin Yang > > 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(). > > This patch was inspired by Chris Wilson's change [1]. > > [1]: https://patchwork.kernel.org/patch/9768741/ > > ... > > --- a/drivers/gpu/drm/i915/i915_gem.c > +++ b/drivers/gpu/drm/i915/i915_gem.c > @@ -2382,12 +2382,26 @@ void __i915_gem_object_invalidate(struct drm_i915_gem_object *obj) > invalidate_mapping_pages(mapping, 0, (loff_t)-1); > } > > +/** This token is used to introduce a kerneldoc comment. > + * Move pages to appropriate lru and release the pagevec. Decrement the ref > + * count of these pages. > + */ But this isn't a kerneldoc comment. At least, I don't think it is. Maybe the parser got smarter when I wasn't looking. > +static inline void check_release_pagevec(struct pagevec *pvec) > +{ > + if (pagevec_count(pvec)) { > + check_move_unevictable_pages(pvec); > + __pagevec_release(pvec); > + cond_resched(); > + } > +} This looks too large to be inlined and the compiler will ignore the `inline' anyway. Otherwise, Acked-by: Andrew Morton . Please go ahead and merge via the appropriate drm tree.