From mboxrd@z Thu Jan 1 00:00:00 1970 From: Benjamin Herrenschmidt Subject: Re: current_thread_info() vs task_thread_info(current) Date: Mon, 18 Jul 2011 21:54:57 +1000 Message-ID: <1310990097.25044.307.camel@pasglop> References: <1310988183.13765.56.camel@twins> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Return-path: Received: from gate.crashing.org ([63.228.1.57]:53732 "EHLO gate.crashing.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756399Ab1GRLzU (ORCPT ); Mon, 18 Jul 2011 07:55:20 -0400 In-Reply-To: <1310988183.13765.56.camel@twins> Sender: linux-arch-owner@vger.kernel.org List-ID: To: Peter Zijlstra Cc: linux-arch@vger.kernel.org, linux-kernel , Thomas Gleixner , "Paul E. McKenney" On Mon, 2011-07-18 at 13:23 +0200, Peter Zijlstra wrote: > So how are we going to solve this? Naively I'd think that > current_thread_info() is short for task_thread_info(current), and thus > the platforms for where this isn't true are broken. > > I mean, what use is the thread_info not of a thread? > > Comments? Thomas just hit a bug in the platform code of said platform (powerpc heh ?) :-) We do it right for hard IRQs and for some reason never did it right for softirqs. The code is like this for the former: static inline void handle_one_irq(unsigned int irq) { .../... call_handle_irq(irq, desc, irqtp, desc->handle_irq); current->thread.ksp_limit = saved_sp_limit; irqtp->task = NULL; /* Set any flag that may have been set on the * alternate stack */ if (irqtp->flags) set_bits(irqtp->flags, &curtp->flags); } So what we need, I suppose is to add those two last line to do_softirq_onstack() as well. Now indeed i386 needs a similar treatment on both hard and soft irqs (along with getting rid of that stupid duplication of call_on_stack in there, I don't think it's worth making the code horrible like that to save one clobber and PeterZ reckons we can probably avoid it using always_inline anyways). I'll let you guys sort i386 out tho, I'll look at fixing ppc tomorrow :-) Cheers, Ben.