Re: [PATCH] driver core: Add branch prediction hints in really_probe()

2018-11-06 Thread Greg KH
On Tue, Nov 06, 2018 at 09:46:30PM +0800, Muchun Song wrote: > If condition is false in most cases. So, add an unlikely() to the if > condition, so that the optimizer assumes that the condition is false. > > Signed-off-by: Muchun Song As Rafael said, don't do stuff like this unless you can actua

Re: [PATCH] driver core: Add branch prediction hints in really_probe()

2018-11-06 Thread Muchun Song
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 >

Re: [PATCH] driver core: Add branch prediction hints in really_probe()

2018-11-06 Thread Rafael J. Wysocki
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 th

Re: [PATCH] driver core: Add branch prediction hints in really_probe()

2018-11-06 Thread Muchun Song
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. Rafael J. Wysocki 于2018年11

Re: [PATCH] driver core: Add branch prediction hints in really_probe()

2018-11-06 Thread Rafael J. Wysocki
On Tue, Nov 6, 2018 at 2:47 PM Muchun Song wrote: > > If condition is false in most cases. So, add an unlikely() to the if > condition, so that the optimizer assumes that the condition is false. > > Signed-off-by: Muchun Song Have you measured the practical impact of this patch in any way? > --

[PATCH] driver core: Add branch prediction hints in really_probe()

2018-11-06 Thread Muchun Song
If condition is false in most cases. So, add an unlikely() to the if condition, so that the optimizer assumes that the condition is false. Signed-off-by: Muchun Song --- drivers/base/dd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/base/dd.c b/drivers/base/dd.