Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2635961imu; Thu, 17 Jan 2019 18:47:47 -0800 (PST) X-Google-Smtp-Source: ALg8bN5ynuVvfgZfFl4iZYjePvPBZtpc2AFpp2Ec48t4IqLIIyvJOeWC4heDQyCLJQ4KVN58tWBq X-Received: by 2002:a62:a1a:: with SMTP id s26mr17603873pfi.31.1547779667262; Thu, 17 Jan 2019 18:47:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547779667; cv=none; d=google.com; s=arc-20160816; b=Mza6dDd+ig5go6qiV94ih6WYr1eqe7v5CzAYUOVpEXQ2Qe2WOD2tFGyA9ndW4qmmMp cKLdGcF15vv/H8JOzFseSvqKCWy+kVhA35vkQjTz2cr8XTZ7Av76WPBLuFQhJe9J38NE +2zKCsRsNkpJoAi9spqoldVg2QdA21iidd/XNLcnqQ7GxJayVu4Ff57Rz8UpP7ksW0U7 9p6IBsms6thCA50BSg2H8fCW/mWnBq+9oMof0Dc7FYElYVNcY7fuuy+hWG3PqZScaOOM pxLUXvGB2My/bBPJCEfanX1i2WR99huXH3ipMC1ORsOB9kjEiwCyL0N3GtP5ZcUZxxwD 6Jgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=rg9eZ8KUAfMVavX1J1HoSlh7nxnbEf5BOIlwXmnAi7g=; b=zOAfImHiNuKRT0E81L56gMgPoh36RRSDauzroIRG1z1EQAdAJ9b6uzAZThWZ6hmHmU FIZRMIZYQbIsjJDEBuQ3FHhvA63582Cwwq4aHKtV1zMlnQ32vlktn9b78Fbm754kmjgV v2/J8ZQbsKUosUneFtIjm1lKp38MP62tR7Ud5P2kgZyZVC2USfgclDEyKe06G2s0TdjU +YdUKY4KTNlt/XPbCBjWUQa8VnPq6T+yYe0+aneKbkqno9z0LLB4D7BTtEJrlWy8MQ8l zkKLZ+ZB4VQZUehicpnfyi9afItytOein0F+Z/IBmd4Sw1IBCp3l2ngc3MwIwxBhcSSN tBkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=NXvva8kD; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=wdc.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j34si3395413pgj.557.2019.01.17.18.47.29; Thu, 17 Jan 2019 18:47:47 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=NXvva8kD; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=wdc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726901AbfARCfk (ORCPT + 99 others); Thu, 17 Jan 2019 21:35:40 -0500 Received: from esa2.hgst.iphmx.com ([68.232.143.124]:9950 "EHLO esa2.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725992AbfARCfk (ORCPT ); Thu, 17 Jan 2019 21:35:40 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1547778941; x=1579314941; h=subject:to:cc:references:from:message-id:date: mime-version:in-reply-to:content-transfer-encoding; bh=S4ml2sjUF5uB3w1kBdojfKVnCcsi+CAQRaRV4WaUbvA=; b=NXvva8kDCAYLl0qCJteF/eloWj+PxESj7Ay32TgRrBOT+PSEKCXFa72B BM9slcu1Tx1JKLJstqSOU1KaBtulzVdi9Udmhuoyi6vRtwfDH70tPVMh0 sZfoLhjC9J90oRCGOPa6lZ09t0EUzklhA4aYTBWFyDTCETiisKai9z+V5 xY0UzNGTY+rpS6sphWzq+0b1uJq2r3hWwfqDY3x86IMJX6JkJere5uQS8 Wkew+lZ9pUb/csh/2w5QtUTgcWOxLcIdizFGc5nXMJ42xhX+1dRmtAghJ KfNtpHzPSPMRCOZ03Q+/R2/Ln5p0HgQlrAz/2fiJ+FFhQnwmmjYe+6RU1 g==; X-IronPort-AV: E=Sophos;i="5.56,489,1539619200"; d="scan'208";a="197168425" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 18 Jan 2019 10:35:42 +0800 Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP; 17 Jan 2019 18:15:19 -0800 Received: from c02v91rdhtd5.sdcorp.global.sandisk.com (HELO [10.111.68.123]) ([10.111.68.123]) by uls-op-cesaip01.wdc.com with ESMTP; 17 Jan 2019 18:35:40 -0800 Subject: Re: [PATCH v2 1/8] RISC-V: Do not wait indefinitely in __cpu_up To: Christoph Hellwig Cc: =?UTF-8?Q?Patrick_St=c3=a4hlin?= , Albert Ou , Jason Cooper , Alan Kao , Dmitriy Cherkasov , Anup Patel , Daniel Lezcano , "linux-kernel@vger.kernel.org" , Michael Clark , Marc Zyngier , Palmer Dabbelt , Andreas Schwab , "linux-riscv@lists.infradead.org" , Thomas Gleixner , Zong Li References: <1546940318-9752-1-git-send-email-atish.patra@wdc.com> <1546940318-9752-2-git-send-email-atish.patra@wdc.com> <20190115135125.GA28946@infradead.org> From: Atish Patra Message-ID: <1995e941-a8cf-c12e-71ae-7b50cf6c0ca5@wdc.com> Date: Thu, 17 Jan 2019 18:35:39 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <20190115135125.GA28946@infradead.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1/15/19 5:51 AM, Christoph Hellwig wrote: >> >> void *__cpu_up_stack_pointer[NR_CPUS]; >> void *__cpu_up_task_pointer[NR_CPUS]; >> +static DECLARE_COMPLETION(cpu_running); >> >> void __init smp_prepare_boot_cpu(void) >> { >> @@ -81,6 +82,7 @@ void __init setup_smp(void) >> >> int __cpu_up(unsigned int cpu, struct task_struct *tidle) >> { >> + int ret = 0; >> int hartid = cpuid_to_hartid_map(cpu); >> tidle->thread_info.cpu = cpu; >> >> @@ -96,10 +98,15 @@ int __cpu_up(unsigned int cpu, struct task_struct *tidle) >> task_stack_page(tidle) + THREAD_SIZE); >> WRITE_ONCE(__cpu_up_task_pointer[hartid], tidle); >> >> - while (!cpu_online(cpu)) >> - cpu_relax(); >> + wait_for_completion_timeout(&cpu_running, >> + msecs_to_jiffies(1000)); > > Having a global completion here worries me. I bet we have some higher > level serialization, but can we comment or even better lockdep assert on > that? > Yes. It is serialized from smp.c in smp_init(). It brings one cpu online at a time for preset_cpu mask. Do we still need a lockdep assert ? Regards, Atish > Also please use up your available lines (72 in commit logs, 80 in source > files) instead of adding spurious line wraps. > > _______________________________________________ > linux-riscv mailing list > linux-riscv@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-riscv >