From mboxrd@z Thu Jan 1 00:00:00 1970 From: Oleg Nesterov Subject: Re: [PATCH] tty: Only wakeup the line discipline idle queue when queue is active Date: Fri, 18 Jan 2013 16:45:04 +0100 Message-ID: <20130118154504.GA28072@redhat.com> References: <50E3FDFA.4070203@suse.cz> <20130102114311.66215bf5@pyramind.ukuu.org.uk> <50E4854E.8060801@suse.cz> <50F66120.50704@linux.vnet.ibm.com> <50F683D9.1080908@linux.vnet.ibm.com> <50F7D8C2.1030506@linux.vnet.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <50F7D8C2.1030506@linux.vnet.ibm.com> Sender: linux-kernel-owner@vger.kernel.org To: Preeti U Murthy Cc: Ivo Sieben , Peter Zijlstra , Ingo Molnar , linux-kernel@vger.kernel.org, Andi Kleen , Jiri Slaby , Alan Cox , linux-serial@vger.kernel.org, Alan Cox , Greg KH List-Id: linux-serial@vger.kernel.org On 01/17, Preeti U Murthy wrote: > > On 01/16/2013 05:32 PM, Ivo Sieben wrote: > > > > I don't have a problem that there is a context switch to the high > > priority process: it has a higher priority, so it probably is more > > important. > > My problem is that even when the waitqueue is empty, the high priority > > thread has a risk to block on the spinlock needlessly (causing context > > switches to low priority task and back to the high priority task) > > > Fair enough Ivo.I think you should go ahead with merging the > waitqueue_active() > wake_up() > logic into the wake_up() variants. This is not easy. We can't simply change wake_up*() helpers or modify __wake_up(). I can't understand why do you dislike Ivo's simple patch. There are a lot of "if (waitqueue_active) wake_up" examples. Even if we add the new helpers (personally I don't think this makes sense) , we can do this later. Why should we delay this fix? Oleg.