Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752511AbbDSOJH (ORCPT ); Sun, 19 Apr 2015 10:09:07 -0400 Received: from bh-25.webhostbox.net ([208.91.199.152]:39387 "EHLO bh-25.webhostbox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751988AbbDSOJD (ORCPT ); Sun, 19 Apr 2015 10:09:03 -0400 Message-ID: <5533B6D7.9050101@roeck-us.net> Date: Sun, 19 Apr 2015 07:08:23 -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: Ingo Molnar , Linus Torvalds CC: Rabin Vincent , Linux Kernel Mailing List , Peter Zijlstra , Thomas Gleixner , "Paul E. McKenney" 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> <55330B32.4010907@roeck-us.net> <20150419033940.GA25145@debian> <20150419093112.GA6139@gmail.com> In-Reply-To: <20150419093112.GA6139@gmail.com> Content-Type: text/plain; charset=windows-1252; 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.0A020201.5533B6FF.00B4,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: 4 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: 1764 Lines: 57 On 04/19/2015 02:31 AM, Ingo Molnar wrote: > > * Linus Torvalds wrote: > >> On Sun, Apr 19, 2015 at 4:48 AM, Linus Torvalds >> wrote: >>> >>> Does that smaller patch work equally well? >> >> .. and here's a properly formatted email and patch. >> >> Linus > >> kernel/smp.c | 4 +++- >> 1 file changed, 3 insertions(+), 1 deletion(-) >> >> diff --git a/kernel/smp.c b/kernel/smp.c >> index 2aaac2c47683..07854477c164 100644 >> --- a/kernel/smp.c >> +++ b/kernel/smp.c >> @@ -159,8 +159,10 @@ static int generic_exec_single(int cpu, struct call_single_data *csd, >> } >> >> >> - if ((unsigned)cpu >= nr_cpu_ids || !cpu_online(cpu)) >> + if ((unsigned)cpu >= nr_cpu_ids || !cpu_online(cpu)) { >> + csd_unlock(csd); >> return -ENXIO; >> + } > > Acked-by: Ingo Molnar > Tested-by: Guenter Roeck > Btw., in this case we should probably also generate a WARN_ONCE() > warning? > > I _think_ most such callers calling an SMP function call for offline > or out of range CPUs are at minimum racy. > Not really; at least the online cpu part is an absolutely normal use case for qemu-arm. Sure, you can argue that "this isn't the real system", and that qemu-arm should be "fixed", but there are reasons - the emulation is (much) slower if the number of CPUs is set to 4, and not everyone who wants to use qemu has a system with as many CPUs as the emulated system would normally have. Thanks, 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/