From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754542Ab3KGWun (ORCPT ); Thu, 7 Nov 2013 17:50:43 -0500 Received: from cantor2.suse.de ([195.135.220.15]:45468 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751228Ab3KGWuh (ORCPT ); Thu, 7 Nov 2013 17:50:37 -0500 Date: Thu, 7 Nov 2013 23:50:34 +0100 From: Jan Kara To: Frederic Weisbecker Cc: Jan Kara , Andrew Morton , LKML , Michal Hocko , Steven Rostedt Subject: Re: [PATCH 2/4] irq_work: Provide a irq work that can be processed on any cpu Message-ID: <20131107225034.GD2054@quack.suse.cz> References: <1383860919-1883-1-git-send-email-jack@suse.cz> <1383860919-1883-3-git-send-email-jack@suse.cz> <20131107221904.GB2054@quack.suse.cz> <20131107222311.GA28130@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20131107222311.GA28130@localhost.localdomain> 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 On Thu 07-11-13 23:23:14, Frederic Weisbecker wrote: > On Thu, Nov 07, 2013 at 11:19:04PM +0100, Jan Kara wrote: > > On Thu 07-11-13 23:13:39, Frederic Weisbecker wrote: > > > But then, who's going to process that work if every CPUs is idle? > > Have a look into irq_work_queue(). There is: > > /* > > * If the work is not "lazy" or the tick is stopped, raise the irq > > * work interrupt (if supported by the arch), otherwise, just wait > > * for the next tick. We do this even for unbound work to make sure > > * *some* CPU will be doing the work. > > */ > > if (!(work->flags & IRQ_WORK_LAZY) || tick_nohz_tick_stopped()) { > > if (!this_cpu_cmpxchg(irq_work_raised, 0, 1)) > > arch_irq_work_raise(); > > } > > > > So we raise an interrupt if there would be no timer ticking (which is > > what I suppose you mean by "CPU is idle"). That is nothing changed by my > > patches... > > Ok but we raise that interrupt locally, not to the other CPUs. True, but that doesn't really matter in this case. Any CPU (including the local one) can handle the unbound work. So from the definition of the unbound work things are OK. Regarding my use for printk - if all (other) CPUs are idle then we can easily afford making the current cpu busy printing, that's not a problem. There's nothing else to do than to print what's remaining in the printk buffer... Honza -- Jan Kara SUSE Labs, CR