From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751399AbdAWUzG (ORCPT ); Mon, 23 Jan 2017 15:55:06 -0500 Received: from mail-pg0-f67.google.com ([74.125.83.67]:33074 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750714AbdAWUzF (ORCPT ); Mon, 23 Jan 2017 15:55:05 -0500 Date: Mon, 23 Jan 2017 15:55:01 -0500 From: Tejun Heo To: Mel Gorman Cc: Vlastimil Babka , Andrew Morton , Linux Kernel , Linux-MM , Hillf Danton , Jesper Dangaard Brouer , Petr Mladek Subject: Re: [PATCH 3/4] mm, page_alloc: Drain per-cpu pages from workqueue context Message-ID: <20170123205501.GA25944@htj.duckdns.org> References: <20170117092954.15413-1-mgorman@techsingularity.net> <20170117092954.15413-4-mgorman@techsingularity.net> <06c39883-eff5-1412-a148-b063aa7bcc5f@suse.cz> <20170120152606.w3hb53m2w6thzsqq@techsingularity.net> <20170123170329.GA7820@htj.duckdns.org> <20170123200412.mkesardc4mckk6df@techsingularity.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170123200412.mkesardc4mckk6df@techsingularity.net> User-Agent: Mutt/1.7.1 (2016-10-04) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, Mel. On Mon, Jan 23, 2017 at 08:04:12PM +0000, Mel Gorman wrote: > What is the actual mechanism that does that? It's not something that > schedule_on_each_cpu does and one would expect that the core workqueue > implementation would get this sort of detail correct. Or is this a proposal > on how it should be done? If you use schedule_on_each_cpu(), it's all fine as the thing pins cpus and waits for all the work items synchronously. If you wanna do it asynchronously, right now, you'll have to manually synchronize work items against the offline callback manually. On this area, the current workqueue behavior is pretty bad. Historically, we didn't distinguish affinity-for-optimization affinity-for-correctness, so we couldn't really enforce strong behaviors on it. We started distinguishing them some releases ago, so I should revisit it soon. Thanks. -- tejun