Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753614AbaG2NMc (ORCPT ); Tue, 29 Jul 2014 09:12:32 -0400 Received: from mail-qg0-f54.google.com ([209.85.192.54]:39890 "EHLO mail-qg0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751587AbaG2NMa (ORCPT ); Tue, 29 Jul 2014 09:12:30 -0400 Date: Tue, 29 Jul 2014 09:12:26 -0400 From: Tejun Heo To: Peter Zijlstra Cc: Christoph Lameter , Sasha Levin , akpm@linux-foundation.org, Gilad Ben-Yossef , Thomas Gleixner , John Stultz , Mike Frysinger , Minchan Kim , Hakan Akkan , Max Krasnyansky , Frederic Weisbecker , "Paul E. McKenney" , linux-kernel@vger.kernel.org, linux-mm@kvack.org, hughd@google.com, viresh.kumar@linaro.org, hpa@zytor.com, mingo@kernel.org, Lai Jiangshan Subject: Re: vmstat: On demand vmstat workers V8 Message-ID: <20140729131226.GS7462@htj.dyndns.org> References: <53D31101.8000107@oracle.com> <20140729075637.GA19379@twins.programming.kicks-ass.net> <20140729120525.GA28366@mtj.dyndns.org> <20140729122303.GA3935@laptop> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140729122303.GA3935@laptop> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org (cc'ing Lai) Hello, On Tue, Jul 29, 2014 at 02:23:03PM +0200, Peter Zijlstra wrote: > > It's because we don't distinguish work items which are per-cpu for > > optimization and per-cpu for correctness and can't automatically flush > > / cancel / block per-cpu work items when a cpu goes down. I like the > > idea of distingushing them but it's gonna take a lot of auditing. > > Just force flush on unplug and fix those that complain. No auditing > needed for that. I'm not sure that's a viable way forward. It's not like we can readily trigger the problematic cases which can lead to long pauses during cpu down. Besides, we need the distinction at the API level, which is the whole point of this. The best way probably is converting all the correctness ones (these are the minorities) over to queue_work_on() so that the per-cpu requirement is explicit. > > Any work item usage which requires per-cpu for correctness should > > implement cpu down hook to flush in-flight work items and block > > further issuance. This hasn't changed from the beginning and was > > necessary even before cmwq. > > I think before cmwq we'd run into the broken affinity warning in the > scheduler. That and work items silently not executed if queued on a downed cpu. IIRC, we also had quite a few broken ones which were per-cpu but w/o cpu down handling which just happened to work most of the time because queueing itself was per-cpu in most cases and we didn't do cpu on/offlining as often back then. During cmwq conversion, I just allowed them as I didn't want to add cpu down hooks for all of the many per-cpu workqueue usages. The lack of the distinction between the two sets has always been there. I agree this can be improved, but at least for now, please add cpu down hooks. We need them right now and they'll be helpful when later separating out the correctness ones. Thanks. -- tejun -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/