Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755922AbdDGKC0 (ORCPT ); Fri, 7 Apr 2017 06:02:26 -0400 Received: from mail.fireflyinternet.com ([109.228.58.192]:57319 "EHLO fireflyinternet.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753246AbdDGKCS (ORCPT ); Fri, 7 Apr 2017 06:02:18 -0400 X-Default-Received-SPF: pass (skip=forwardok (res=PASS)) x-ip-name=78.156.65.138; Date: Fri, 7 Apr 2017 11:02:11 +0100 From: Chris Wilson To: Andrea Arcangeli Cc: Martin Kepplinger , Thorsten Leemhuis , daniel.vetter@intel.com, Dave Airlie , intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: Re: [PATCH 2/5] i915: flush gem obj freeing workqueues to add accuracy to the i915 shrinker Message-ID: <20170407100211.GG10496@nuc-i3427.alporthouse.com> Mail-Followup-To: Chris Wilson , Andrea Arcangeli , Martin Kepplinger , Thorsten Leemhuis , daniel.vetter@intel.com, Dave Airlie , intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org References: <87pogtplxr.fsf@intel.com> <20170406232347.988-1-aarcange@redhat.com> <20170406232347.988-3-aarcange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170406232347.988-3-aarcange@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 546 Lines: 13 On Fri, Apr 07, 2017 at 01:23:44AM +0200, Andrea Arcangeli wrote: > Waiting a RCU grace period only guarantees the work gets queued, but > until after the queued workqueue returns, there's no guarantee the > memory was actually freed. So flush the work to provide better > guarantees to the reclaim code in addition of waiting a RCU grace > period to pass. We are not allowed to call flush_work() from the shrinker, the workqueue doesn't have and can't have the right reclaim flags. -Chris -- Chris Wilson, Intel Open Source Technology Centre