Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1975432imu; Tue, 6 Nov 2018 07:14:18 -0800 (PST) X-Google-Smtp-Source: AJdET5fc8ekJtD7bQZ3TqUSPIX1ZxuKQZ6lM47lG6/HPaDbegz/Pq9MfBmAMxkpx54jBZF88FXLY X-Received: by 2002:a17:902:b943:: with SMTP id h3-v6mr25273912pls.124.1541517258508; Tue, 06 Nov 2018 07:14:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541517258; cv=none; d=google.com; s=arc-20160816; b=sCXnPqzYES4O/rNDzC1Go47tooeaEkGan8VCwEsFj3xdM0i8pZN0nGvPhqLwAaTgIX 8p14ZjTW1/gXr+b2dHhpFyIs2VpNZ1eEklx4CmZ/BSr2AHZ72mwnw6JJZEIy7kDhm+Uh 40vc13TB/KUu9HWEC67enVDwRic8vIwyMcpdw/yHiiP9yDyXODIORCaROyXZIg03pXOF 90sshABjiH8xMq50w0HLxWX7nElbQx0cTJHNQbEF3b+Nz4DwjJ484gQKh3VPFsmgw2R9 hc65xPvPOHG23x7b5TMF2Wfib5xQXo+UgInBenqjA7tKVre5TmLzMtDUZRL0pKk19jw+ buWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=I8QaQfaVRc6jFfZnnn+6lgjFF336Oeto4DpPOMWWZcY=; b=LiZ/0Z3EsVOt/vNQK6pEHF3BuMZKsDY9E9qK0P2hEcY33cy1lY1sP9UoJpnoftYU3q iaxFsAwAb7xPxRbslyA5B6Gwenl3dzIBS4e4f6cJLhZBu1hiwi+JoKrtY1ShiKvhpuHc kbSMRmpHmqEt409OavPcdKQex7jKAT9JEicUBpzzY/LRo4FMb/uKKeErITNJaB1ZghlS Hr824QYT2yWrHnsF1f3fwLqaHOkfxIITCL4eLt7WG4HQU6rGRgc2vK5LqF6UpxF2aUbl tvqNDtvUktFPimDzYrXN9QQsKbWkTFwMRGZmqjgMeuh27SLzqkaacHMSdHtSpPWvdgI/ I0tA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=rsZvZC7d; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b8si7424203pgi.575.2018.11.06.07.14.02; Tue, 06 Nov 2018 07:14:18 -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=pass header.i=@gmail.com header.s=20161025 header.b=rsZvZC7d; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730670AbeKGAio (ORCPT + 99 others); Tue, 6 Nov 2018 19:38:44 -0500 Received: from mail-qt1-f193.google.com ([209.85.160.193]:35588 "EHLO mail-qt1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729574AbeKGAio (ORCPT ); Tue, 6 Nov 2018 19:38:44 -0500 Received: by mail-qt1-f193.google.com with SMTP id v11so2939082qtc.2 for ; Tue, 06 Nov 2018 07:13:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=I8QaQfaVRc6jFfZnnn+6lgjFF336Oeto4DpPOMWWZcY=; b=rsZvZC7daApWrrU6BSyo5z7Kp2TBe11K1Cgc+UpZXQUQwVitRGtERAJJb9GbDJpeb0 Ah7JlHOnYJFWTQUDMmZRABocDWh2+3CdwJGod8hSil313C2byLO8MOoq6MZ9YtVCRNCT diHCe1WhU1eCWMHl17iQUqW5/pT2nvOA+X0l0AlvnyTDYZt5DimKJQwBmmp7jhhsuTYN nQBO/+SX4pPhFQrKAuN6CdaCg96b4/Cbm3u6EATSUkj1jgwj69x0fzEfeh1CJvoiJwQC s3guCy8AucH9ww6VaQWOx3iEvAKbAUevj5vc3UNZdJ1U3s+PbdGLiXfIoeuGJi6NNXR5 rx+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=I8QaQfaVRc6jFfZnnn+6lgjFF336Oeto4DpPOMWWZcY=; b=FndJFCtuMTsAVihpazOWwdZdQ3NAoIq9GkLMRtvHJqVLq9gSI9WTjCdVTtq0RfVj0I uxJs7uFWAPJ7eRl7fhcHHT6J++PM3lc2TMozv7Rii4rL9RaQuDkpvBZhgcu1RHiJTscM zUmyLRVPiRmPDTDVMDR+W32lUV1Jayg3QR089sLW0w7PTmb6Md/1nGh4WHufZegSFyN1 SM7/L5jNx137zozvFog8ckLjNN0o7ZhjWQHVkUFBPMc17kTCo9Iu6n1hU0bpcvDQK6Il 3M4SGRJ4ncznAKLlKBPyAHn7On9rjMrH1+DOc/Ke/Pw/Pk3+VhhqoDwc09HboYLhWYX8 mDuA== X-Gm-Message-State: AGRZ1gIQ0ZDdx3uyUGO/IJ8sYmkZxbi5GagjiXkYkpidHnBEQDLpwi6M FlB7zE24x4rJgzfIJ+eEsSBSou+d9r78TT4WPX76OF1Q X-Received: by 2002:ac8:240a:: with SMTP id c10mr14640681qtc.93.1541517183329; Tue, 06 Nov 2018 07:13:03 -0800 (PST) MIME-Version: 1.0 References: <20181106134630.29591-1-smuchun@gmail.com> In-Reply-To: From: Muchun Song Date: Tue, 6 Nov 2018 23:12:51 +0800 Message-ID: Subject: Re: [PATCH] driver core: Add branch prediction hints in really_probe() To: rafael@kernel.org Cc: gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Rafael, > > On Tue, Nov 6, 2018 at 3:43 PM Muchun Song wrote: > > > > Hi Rafael, > > > > If we want the driver core to test driver remove functions, we can > > enable CONFIG_DEBUG_TEST_DRIVER_REMOVE. This option is > > just for testing it. So, in most cases, the option is disabled and the if > > condition is false. So I think we can add an unlikely() to it. > > Yes, it can be added there, but does it really need to be added? > > If the conditions are false all the time, the branch predictor in the > processor should be able to deal with it just fine. > > And if they are false already at build time, the compiler should just > optimize them away. Thank you for your explanation. I really didn't take into account the situation you said. Yeah, the compiler can optimize them away or the processor can deal with it. So, we don't need to add unlikely() to it. The patch does't make sense. Thanks.