Re: [PATCH RFC/RFT v2 3/8] s390: move cacheinfo sysfs to generic cacheinfo infrastructure

From: Heiko Carstens
Date: Tue Feb 18 2014 - 04:45:54 EST


Hi Sudeep,

> > Please have a look at these two commits which should describe why things
> > are as they are on s390:
> >
> > 881730ad365130f64b5c70c40904b04eb3b79de3
> > "s390/cache: expose cpu cache topology via sysfs"
> > 6668022c7bde3fdc96d3d257294a7216c7a46829
> > "s390/cache: add cpu cache information to /proc/cpuinfo"
> >
>
> I need your help to get few things clarified.
>
> IIUC, I see that shared caches are not exposed via sysfs but there are exposed
> through /proc/cpuinfo, right ?

Yes.

> If yes, based on your above statement, shared
> cpus are may not be system-wide, then how can /proc/cpuinfo show shared
> cache info.

/proc/cpuinfo shows the information of the underlying hardware but we
cannot tell which second level (virtual) cpus share which caches.
There simply is no such interface available.

Also, if there would be such an interface, it would be only valid until
the hypervisor decides to schedule a virtual cpu on a different physical
cpu; which in turn would mean that we would have to update the cpu maps
all the time.

In order to avoid all those games, we decided to only expose cpu private
caches via sysfs, so we obviously have static cpu maps.

However since the physical cache information may be of interest for a
guest operating system there is the second interface /proc/cpuinfo
which provides this.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/