Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3261440imu; Wed, 7 Nov 2018 07:38:02 -0800 (PST) X-Google-Smtp-Source: AJdET5fzgchPB0hi7haupPfBMtDdfuOSqNMVRsmwDdPJ1iWJR89BP7D2HA1SQTqdEI3bDuZX60fT X-Received: by 2002:a62:5c41:: with SMTP id q62-v6mr675204pfb.171.1541605082092; Wed, 07 Nov 2018 07:38:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541605082; cv=none; d=google.com; s=arc-20160816; b=J9xB83Gp4GkesIzuDX+4yAyBVeGpLuPrHQOjBDvESyCBdcQrMpmO8M1nZkxNMuxQbP 9542jHC/onb6gAB5XoNL7qiammq48fuTP46ekqXBkAv0NealSrubPm8v/K/L4VczUXG4 ZxNIzAAYpUhBDoHH+tR0X/KNuZU/deTdkfIrSMkBTGa8J+FDKgkO235GlWAFflPBsaoQ +bz6zoYEXMaRz7vDW/viI1yS0G2Dx38bVwkXmbqgrLzUWFfUn5QmY1mkyOJobHilnsSy ZMzVyi0MYd2ay80MvdTa6WXOHc7ur49jf9/BVfBoFC7CwrYDGyjWUX0RjAxVlllznn5Z PBCg== 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=uztajfIDC2ltCghCqcd9/PNL1nn4nKMsNj9pcdOhj2Q=; b=axhT9nkNAS0vR/Dw2DB1pq7fjvq7/vvOt5dzIIIOJPyJcGNVQplhDRqA99fe5VZSBm nez8LacDm7dtJgTKOrxMB2poUnvuGIERFcfCP6uqT7K4vPXzKHavGsqZdmJTnfsOXsTM mqfZxsvlXLZwvtktAQYGbY/wMfk4+y4NRhdgW2Y/VeI1ycQHURL/Xc9A4lUQbFiAwy/7 Tp9BLG4Ew87jF1tUFzQuDvHcgRkzhk+5yRCvtVhvHzFKl2+Ewm+qRRnPd5wzximBw/n+ DkIY2+sXifnEV+atHCV1S1JqafkEW6IUCL3GcoeF46eU1FZ58caCKiayOQY3IsaEkPze H4WQ== 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 e67-v6si923455plb.401.2018.11.07.07.37.46; Wed, 07 Nov 2018 07:38:02 -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 S1730888AbeKHBGq convert rfc822-to-8bit (ORCPT + 99 others); Wed, 7 Nov 2018 20:06:46 -0500 Received: from mail.fireflyinternet.com ([109.228.58.192]:52171 "EHLO fireflyinternet.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727387AbeKHBGq (ORCPT ); Wed, 7 Nov 2018 20:06:46 -0500 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 14387477-1500050 for multiple; Wed, 07 Nov 2018 15:34:53 +0000 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8BIT To: Andrew Morton From: Chris Wilson In-Reply-To: <20181106101211.d2e4857aa36ea8ffbd870d2f@linux-foundation.org> Cc: intel-gfx@lists.freedesktop.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Kuo-Hsin Yang , Joonas Lahtinen , Peter Zijlstra , Dave Hansen References: <20181106093100.71829-1-vovoy@chromium.org> <20181106132324.17390-1-chris@chris-wilson.co.uk> <20181106101211.d2e4857aa36ea8ffbd870d2f@linux-foundation.org> Message-ID: <154160489128.4321.4951578054574913878@skylake-alporthouse-com> User-Agent: alot/0.6 Subject: Re: [PATCH v7] mm, drm/i915: mark pinned shmemfs pages as unevictable Date: Wed, 07 Nov 2018 15:34:51 +0000 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Andrew Morton (2018-11-06 18:12:11) > 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. Applied both corrections. > Otherwise, Acked-by: Andrew Morton . Please > go ahead and merge via the appropriate drm tree. Thank you, pushed to drm-intel, expected to arrive around 4.21. -Chris