Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753750AbbDSAhG (ORCPT ); Sat, 18 Apr 2015 20:37:06 -0400 Received: from bh-25.webhostbox.net ([208.91.199.152]:60876 "EHLO bh-25.webhostbox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751197AbbDSAhC (ORCPT ); Sat, 18 Apr 2015 20:37:02 -0400 Message-ID: <5532F890.5000800@roeck-us.net> Date: Sat, 18 Apr 2015 17:36:32 -0700 From: Guenter Roeck User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Linus Torvalds CC: Linux Kernel Mailing List , Peter Zijlstra , Ingo Molnar Subject: Re: qemu:arm test failure due to commit 8053871d0f7f (smp: Fix smp_call_function_single_async() locking) References: <20150418232325.GA22411@roeck-us.net> <20150418234050.GA5987@roeck-us.net> In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Authenticated_sender: linux@roeck-us.net X-OutGoing-Spam-Status: No, score=-1.0 X-CTCH-PVer: 0000001 X-CTCH-Spam: Unknown X-CTCH-VOD: Unknown X-CTCH-Flags: 0 X-CTCH-RefID: str=0001.0A020202.5532F8AE.006E,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0 X-CTCH-Score: 0.000 X-CTCH-ScoreCust: 0.000 X-CTCH-Rules: X-CTCH-SenderID: linux@roeck-us.net X-CTCH-SenderID-Flags: 0 X-CTCH-SenderID-TotalMessages: 3 X-CTCH-SenderID-TotalSpam: 0 X-CTCH-SenderID-TotalSuspected: 0 X-CTCH-SenderID-TotalConfirmed: 0 X-CTCH-SenderID-TotalBulk: 0 X-CTCH-SenderID-TotalVirus: 0 X-CTCH-SenderID-TotalRecipients: 0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bh-25.webhostbox.net X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - roeck-us.net X-Get-Message-Sender-Via: bh-25.webhostbox.net: mailgid no entry from get_relayhosts_entry X-Source: X-Source-Args: X-Source-Dir: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2556 Lines: 63 On 04/18/2015 05:04 PM, Linus Torvalds wrote: > On Sat, Apr 18, 2015 at 7:40 PM, Guenter Roeck wrote: >> On Sat, Apr 18, 2015 at 04:23:25PM -0700, Guenter Roeck wrote: >>> >>> my qemu test for arm:vexpress fails with the latest upstream kernel. It fails >>> hard - I don't get any output from the console. Bisect points to commit >>> 8053871d0f7f ("smp: Fix smp_call_function_single_async() locking"). >>> Reverting this commit fixes the problem. > > Hmm. It being qemu, can you look at where it seems to lock? > I'll try. It must be very early in the boot process, prior to console initialization - if I load qemu without -nographic I only get "Guest has not initialized the display (yet)". >> Additional observation: The system boots if I add "-smp cpus=4" to the qemu >> options. It does still hang, however, with "-smp cpus=2" and "-smp cpus=3". > > Funky. > > That patch still looks obviously correct to me after looking at it > again, but I guess we need to revert it if somebody can't see what's > wrong. > > It does make async (wait=0) smp_call_function_single() possibly be > *really* asynchronous, ie the 'csd' ends up being released and can be > re-used even before the call-single function has completed. That > should be a good thing, but I wonder if that triggers some ARM bug. > > Instead of doing a full revert, what happens if you replace this part: > > + /* Do we wait until *after* callback? */ > + if (csd->flags & CSD_FLAG_SYNCHRONOUS) { > + func(info); > + csd_unlock(csd); > + } else { > + csd_unlock(csd); > + func(info); > + } > > with just > > + func(info); > + csd_unlock(csd); > > ie keeping the csd locked until the function has actually completed? I > guess for completeness, we should do the same thing for the cpu == > smp_processor_id() case (see the "We can unlock early" comment). > > Now, if that makes a difference, I think it implies a bug in the > caller, so it's not the right fix, but it would be an interesting > thing to test. > I applied the above. No difference. Applying the same change for the cpu == smp_processor_id() case does not make a difference either. Guenter -- 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/