Re: [LKP] [driver core] 570d020012: will-it-scale.per_thread_ops -12.2% regression

From: Greg Kroah-Hartman
Date: Thu Feb 21 2019 - 04:12:25 EST


On Thu, Feb 21, 2019 at 04:39:27PM +0800, Wei Yang wrote:
> >>> I don't think this is an issues of struct device. As you said, struct
> >>> device isn't access much during test. Struct device may share slab page
> >>> with some other data structures (signal related, or fd related (as in
> >>> some other test cases)), so that the alignment of these data structures
> >>> are affected, so caused the performance regression.
> >>
> >> But allocation of a structure should always be "properly" aligned, no
> >> matter what something else did in the system as that is what kmalloc
> >> ensures. If not, then we have problems in our memory allocator :)
> >>
> >> So something is odd here, but I don't think that is it...
> >
> >If all these data structure are allocated with kmalloc() instead of
> >kmem_cache_alloc(), then my guessing above seems incorrect ...
> >
>
> Seems we don't have special kmem_cache for device and device_private.

Nor do we need one :)

Remember, 'struct device' is included inside lots of other structures
already, it is not very often created "on its own."

thanks,

greg k-h