> From: Liu, Yi L
> Sent: Tuesday, October 24, 2023 11:06 PM
> +
> +static int iommufd_group_do_replace_paging(struct iommufd_group
> *igroup,
> +struct iommufd_hw_pagetable
> *hwpt)
> +{
> + struct iommufd_hw_pagetable *old_hwpt = igroup->hwpt;
> +
On 10/24/23 3:43 PM, Yuran Pereira wrote:
As it was pointed out by Yonghong Song [1], in the bpf selftests the use
of the ASSERT_* series of macros is preferred over the CHECK macro.
This patch replaces all CHECK calls in bpf_iter with the appropriate
ASSERT_* macros.
[1] https://lore.kernel.o
On 10/24/23 7:28 PM, Kui-Feng Lee wrote:
Thank you for the patches.
I found you have two patches in this set.
You can generate both patch at once with git format-patch.
format-patch will give each patch a number in their order.
For example, the subject of this message will be
[PATCH bpf-nex
On 2023/10/25 02:19, Nicolin Chen wrote:
On Tue, Oct 24, 2023 at 03:00:49PM -0300, Jason Gunthorpe wrote:
On Tue, Oct 24, 2023 at 10:50:58AM -0700, Nicolin Chen wrote:
The point is for the user_data to always be available, the driver
needs to check it if it is passed.
This should all be plumb
On Tue, Oct 24, 2023 at 1:33 PM Nhat Pham wrote:
>
> From: Domenico Cerasuolo
>
> Currently, we only have a single global LRU for zswap. This makes it
> impossible to perform worload-specific shrinking - an memcg cannot
> determine which pages in the pool it owns, and often ends up writing
> page
Thank you for the patches.
I found you have two patches in this set.
You can generate both patch at once with git format-patch.
format-patch will give each patch a number in their order.
For example, the subject of this message will be
[PATCH bpf-next 2/2] selftest/bpf: Add malloc
And, y
Since some malloc calls in bpf_iter may at times fail,
this patch adds the appropriate fail checks, and ensures that
any previously allocated resource is appropriately destroyed
before returning the function.
This is patch 2 in the sequence should be applied after d1a88d37cecc
"selftests/bpf: Conv
On 10/24/23 11:00 PM, Yi Liu wrote:
This adds the scalable mode check before allocating the nested parent domain
as checking nested capability is not enough. User may turn off scalable mode
which also means no nested support even if the hardware supports it.
Fixes: c97d1b20d383 ("iommu/vt-d: Add
On Mon, 23 Oct 2023 15:50:33 -0400 Lucas Karpinski wrote:
> This is the same issue and the same fix as posted by Adrien Therry.
> Link: https://lore.kernel.org/all/20221101184809.50013-1-athie...@redhat.com/
Let's not let the hacks spread.
We suggested two options in the linked thread.
Another on
On Tue, Oct 24, 2023 at 08:14:11AM -0700, Yi Liu wrote:
> From: Lu Baolu
>
> This adds the support for IOMMU_HWPT_DATA_VTD_S1 type. And 'nested_parent'
> is added to mark the nested parent domain to sanitize the input parent domain.
>
> Signed-off-by: Lu Baolu
> Signed-off-by: Yi Liu
> ---
>
As it was pointed out by Yonghong Song [1], in the bpf selftests the use
of the ASSERT_* series of macros is preferred over the CHECK macro.
This patch replaces all CHECK calls in bpf_iter with the appropriate
ASSERT_* macros.
[1] https://lore.kernel.org/lkml/0a142924-633c-44e6-9a92-2dc019656...@l
Add the list of devices expected to be probed from the USB and PCI
busses on the google,spherion machine. The USB host controller at
1120 is shared between two busses, for USB2 and USB3, so an
additional match is used to select the USB2 bus.
Signed-off-by: Nícolas F. R. A. Prado
---
tools/t
Add a new test to verify that all expected devices from discoverable
busses (ie USB, PCI) on a given Devicetree-based platform have been
successfully instantiated and probed by a driver.
The per-platform list of expected devices is selected based on
compatible and stored under the boards/ director
This is part of an effort to improve detection of regressions impacting
device probe on all platforms. The recently merged DT kselftest [1]
detects probe issues for all devices described statically in the DT.
That leaves out devices discovered at run-time from discoverable busses.
This is where
Hello:
This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski :
On Mon, 23 Oct 2023 18:04:22 +0530 you wrote:
> Change ifconfig with ip command,
> on a system where ifconfig is
> not used this script will not
> work correcly.
>
> Test result with this patchset:
>
> [...]
Here i
Currently, we only shrink the zswap pool when the user-defined limit is
hit. This means that if we set the limit too high, cold data that are
unlikely to be used again will reside in the pool, wasting precious
memory. It is hard to predict how much zswap space will be needed ahead
of time, as this
From: Domenico Cerasuolo
Currently, we only have a single global LRU for zswap. This makes it
impossible to perform worload-specific shrinking - an memcg cannot
determine which pages in the pool it owns, and often ends up writing
pages from other memcgs. This issue has been previously observed in
From: Domenico Cerasuolo
The memcg-zswap self test is updated to adjust to the behavior change
implemented by commit 87730b165089 ("zswap: make shrinking memcg-aware"),
where zswap performs writeback for specific memcg.
Signed-off-by: Domenico Cerasuolo
Signed-off-by: Nhat Pham
---
tools/test
From: Domenico Cerasuolo
Since zswap now writes back pages from memcg-specific LRUs, we now need a
new stat to show writebacks count for each memcg.
Suggested-by: Nhat Pham
Signed-off-by: Domenico Cerasuolo
Signed-off-by: Nhat Pham
---
include/linux/vm_event_item.h | 1 +
mm/memcontrol.c
The interface of list_lru is based on the assumption that the list node
and the data it represents belong to the same allocated on the correct
node/memcg. While this assumption is valid for existing slab objects LRU
such as dentries and inodes, it is undocumented, and rather inflexible
for certain
Changelog:
v4:
* Rename list_lru_add to list_lru_add_obj and __list_lru_add to
list_lru_add (patch 1) (suggested by Johannes Weiner and
Yosry Ahmed)
* Some cleanups on the memcg aware LRU patch (patch 2)
(suggested by Yosry Ahmed)
* Use event interface for the new per-cg
On Wed, Sep 20, 2023 at 4:49 AM Maxime Ripard wrote:
>
> Kunit recently gained support to setup attributes, the first one being
> the speed of a given test, then allowing to filter out slow tests.
>
> A slow test is defined in the documentation as taking more than one
> second. There's an another
> -Original Message-
> From: Marcos Paulo de Souza
>
...
> Per the kselftests documentation[1], the gen_tar target is used to package the
> tests to run "on different systems". But what if the different system has
> different libraries/library versions? Wouldn't it be a problem?
>
...
Hi,
while testing a new patch on the livepatch kselftests, I was testing the gen_tar
target and I figured that we only copy the resulting binaries to the final tar
file.
Per the kselftests documentation[1], the gen_tar target is used to package the
tests to run "on different systems". But what if
On Tue, Oct 24, 2023 at 03:00:49PM -0300, Jason Gunthorpe wrote:
> On Tue, Oct 24, 2023 at 10:50:58AM -0700, Nicolin Chen wrote:
>
> > > The point is for the user_data to always be available, the driver
> > > needs to check it if it is passed.
> > >
> > > This should all be plumbed to allow drive
On Tue, Oct 24, 2023 at 10:50:58AM -0700, Nicolin Chen wrote:
> > The point is for the user_data to always be available, the driver
> > needs to check it if it is passed.
> >
> > This should all be plumbed to allow drivers to also customize their
> > paging domains too.
>
> We don't have a use c
On Tue, Oct 24, 2023 at 08:05:59AM -0700, Yi Liu wrote:
> Jason Gunthorpe (2):
> iommufd: Rename IOMMUFD_OBJ_HW_PAGETABLE to IOMMUFD_OBJ_HWPT_PAGING
> iommufd/device: Wrap IOMMUFD_OBJ_HWPT_PAGING-only configurations
>
> Lu Baolu (1):
> iommu: Add IOMMU_DOMAIN_NESTED
>
> Nicolin Chen (6):
>
On Tue, Oct 24, 2023 at 02:31:39PM -0300, Jason Gunthorpe wrote:
> On Tue, Oct 24, 2023 at 10:28:45AM -0700, Nicolin Chen wrote:
> > On Tue, Oct 24, 2023 at 02:18:10PM -0300, Jason Gunthorpe wrote:
> > > On Tue, Oct 24, 2023 at 08:06:06AM -0700, Yi Liu wrote:
> > > > @@ -195,6 +279,10 @@ int iommuf
On Tue, Oct 24, 2023 at 08:06:06AM -0700, Yi Liu wrote:
> static inline void iommufd_hw_pagetable_put(struct iommufd_ctx *ictx,
> struct iommufd_hw_pagetable *hwpt)
> {
> - struct iommufd_hwpt_paging *hwpt_paging = to_hwpt_paging(hwpt);
> + if (WA
On Tue, Oct 24, 2023 at 10:28:45AM -0700, Nicolin Chen wrote:
> On Tue, Oct 24, 2023 at 02:18:10PM -0300, Jason Gunthorpe wrote:
> > On Tue, Oct 24, 2023 at 08:06:06AM -0700, Yi Liu wrote:
> > > @@ -195,6 +279,10 @@ int iommufd_hwpt_alloc(struct iommufd_ucmd *ucmd)
> > > if (pt_obj->type == IOMMU
On Tue, Oct 24, 2023 at 02:18:10PM -0300, Jason Gunthorpe wrote:
> On Tue, Oct 24, 2023 at 08:06:06AM -0700, Yi Liu wrote:
> > @@ -195,6 +279,10 @@ int iommufd_hwpt_alloc(struct iommufd_ucmd *ucmd)
> > if (pt_obj->type == IOMMUFD_OBJ_IOAS) {
> > struct iommufd_hwpt_paging *hwpt_pagi
On Tue, Oct 24, 2023 at 02:18:10PM -0300, Jason Gunthorpe wrote:
> On Tue, Oct 24, 2023 at 08:06:06AM -0700, Yi Liu wrote:
> > @@ -195,6 +279,10 @@ int iommufd_hwpt_alloc(struct iommufd_ucmd *ucmd)
> > if (pt_obj->type == IOMMUFD_OBJ_IOAS) {
> > struct iommufd_hwpt_paging *hwpt_pagi
On Tue, Oct 24, 2023 at 08:06:01AM -0700, Yi Liu wrote:
> domain_alloc_user op already accepts user flags for domain allocation, add
> a parent domain pointer and a driver specific user data support as well.
>
> Add a struct iommu_user_data as a bundle of data_ptr/data_len/type from an
> iommufd c
On Tue, Oct 24, 2023 at 08:06:06AM -0700, Yi Liu wrote:
> @@ -195,6 +279,10 @@ int iommufd_hwpt_alloc(struct iommufd_ucmd *ucmd)
> if (pt_obj->type == IOMMUFD_OBJ_IOAS) {
> struct iommufd_hwpt_paging *hwpt_paging;
>
> + if (cmd->data_type != IOMMU_HWPT_DATA_NONE) {
On Tue, Oct 24, 2023 at 08:06:06AM -0700, Yi Liu wrote:
> +static struct iommufd_hwpt_nested *
> +iommufd_hwpt_nested_alloc(struct iommufd_ctx *ictx,
> + struct iommufd_hwpt_paging *parent,
> + struct iommufd_device *idev, u32 flags,
> +
On Fri, Oct 20, 2023 at 06:21:40AM +0200, Nicolas Schier wrote:
> On Thu, Oct 19, 2023 at 03:50:05PM -0300, Marcos Paulo de Souza wrote:
> > On Sat, Oct 14, 2023 at 05:35:55PM +0900, Masahiro Yamada wrote:
> > > On Tue, Oct 10, 2023 at 5:43 AM Marcos Paulo de Souza
> > > wrote:
> > > >
> > > > Hi
On Tue, Oct 24, 2023 at 08:06:04AM -0700, Yi Liu wrote:
> static int iommufd_group_do_replace_paging(struct iommufd_group *igroup,
> -struct iommufd_hw_pagetable *hwpt)
> +struct iommufd_hwpt_paging
> *hwpt_paging)
>
Oct 22, 2023 11:37:05 Willy Tarreau :
> On Tue, Oct 10, 2023 at 02:34:00PM +0200, Thomas Weißschuh wrote:
>> This new target generates a .config if none exists yet.
>>
>> Also drop the defconfig target with its hidden call to 'mrproper' which
>> is fairly invasive.
>> If users want to overwrite th
On Tue, Oct 24, 2023 at 06:06:11PM +0200, Thomas Weißschuh wrote:
> Oct 22, 2023 11:21:16 Willy Tarreau :
>
> > On Tue, Oct 10, 2023 at 02:33:57PM +0200, Thomas Weißschuh wrote:
> >> qemu for LoongArch does not work properly with direct kernel boot.
> >> The kernel will panic during initializatio
On 2023/10/24 23:56, Joao Martins wrote:
On 24/10/2023 16:06, Yi Liu wrote:
domain_alloc_user op already accepts user flags for domain allocation, add
a parent domain pointer and a driver specific user data support as well.
Add a struct iommu_user_data as a bundle of data_ptr/data_len/type from
Oct 22, 2023 11:31:32 Willy Tarreau :
> On Tue, Oct 10, 2023 at 02:33:59PM +0200, Thomas Weißschuh wrote:
>> Out of tree builds are much more convenient when building for multiple
>> architectures or configurations in parallel.
>>
>> Only absolute O= parameters are supported as Makefile.include wi
Oct 22, 2023 11:21:16 Willy Tarreau :
> On Tue, Oct 10, 2023 at 02:33:57PM +0200, Thomas Weißschuh wrote:
>> qemu for LoongArch does not work properly with direct kernel boot.
>> The kernel will panic during initialization and hang without any output.
>>
>> When booting in EFI mode everything work
On 24/10/2023 16:06, Yi Liu wrote:
> domain_alloc_user op already accepts user flags for domain allocation, add
> a parent domain pointer and a driver specific user data support as well.
>
> Add a struct iommu_user_data as a bundle of data_ptr/data_len/type from an
> iommufd core uAPI structure. M
Hi Aishwarya,
On 10/24/23 5:43 PM, Aishwarya TCV wrote:
>
>
> On 06/10/2023 11:07, Muhammad Usama Anjum wrote:
>> Remove duplicate defines which are already defined in kernel headers and
>> re-definition isn't required.
>>
>> Signed-off-by: Muhammad Usama Anjum
>> ---
>
> Hi Muhammad,
>
> Cur
Correct header file is needed for getting CLOSE_RANGE_* macros.
Previously it was tested with newer glibc which didn't show the need to
include the header which was a mistake.
Fixes: ec54424923cf ("selftests: core: remove duplicate defines")
Reported-by: Aishwarya TCV
Link: https://lore.kernel.or
From: Lu Baolu
This adds helper for accepting user parameters and allocate a nested
domain.
Reviewed-by: Kevin Tian
Signed-off-by: Jacob Pan
Signed-off-by: Lu Baolu
Signed-off-by: Yi Liu
---
drivers/iommu/intel/Makefile | 2 +-
drivers/iommu/intel/iommu.h | 2 ++
drivers/iommu/intel/nest
This adds IOMMU_HWPT_DATA_VTD_S1 for stage-1 hw_pagetable of Intel
VT-d and the corressponding data structure for userspace specified parameter
for the domain allocation.
Reviewed-by: Kevin Tian
Signed-off-by: Yi Liu
---
include/uapi/linux/iommufd.h | 30 ++
1 file c
From: Lu Baolu
The nested domain fields are exclusive to those that used for a DMA
remapping domain. Use union to avoid memory waste.
Reviewed-by: Kevin Tian
Signed-off-by: Lu Baolu
Signed-off-by: Yi Liu
---
drivers/iommu/intel/iommu.h | 36 ++--
1 file change
This adds the helper for setting the nested domain to a device hence
enable nested domain usage on Intel VT-d.
Signed-off-by: Jacob Pan
Signed-off-by: Lu Baolu
Signed-off-by: Yi Liu
---
drivers/iommu/intel/nested.c | 54
1 file changed, 54 insertions(+)
di
This makes the helpers visible to nested.c.
Suggested-by: Lu Baolu
Reviewed-by: Kevin Tian
Reviewed-by: Lu Baolu
Signed-off-by: Yi Liu
---
drivers/iommu/intel/iommu.c | 15 ++-
drivers/iommu/intel/iommu.h | 7 +++
2 files changed, 13 insertions(+), 9 deletions(-)
diff --git
From: Lu Baolu
When remapping hardware is configured by system software in scalable mode
as Nested (PGTT=011b) and with PWSNP field Set in the PASID-table-entry,
it may Set Accessed bit and Dirty bit (and Extended Access bit if enabled)
in first-stage page-table entries even when second-stage map
From: Lu Baolu
This adds the support for IOMMU_HWPT_DATA_VTD_S1 type. And 'nested_parent'
is added to mark the nested parent domain to sanitize the input parent domain.
Signed-off-by: Lu Baolu
Signed-off-by: Yi Liu
---
drivers/iommu/intel/iommu.c | 67 +
dr
From: Lu Baolu
The configurations are passed in from the user when the user domain is
allocated. This helper interprets these configurations according to the
data structure defined in uapi/linux/iommufd.h. The EINVAL error will be
returned if any of configurations are not compatible with the hard
This is the first part to add Intel VT-d nested translation based on IOMMUFD
nesting infrastructure. As the iommufd nesting infrastructure series[1],
iommu core supports new ops to allocate domains with user data. For nesting,
the user data is vendor-specific, IOMMU_HWPT_DATA_VTD_S1 is defined for
From: Nicolin Chen
Add nested domain support in the ->domain_alloc_user op with some proper
sanity checks. Then, add a domain_nested_ops for all nested domains and
split the get_md_pagetable helper into paging and nested helpers.
Also, add an iotlb as a testing property of a nested domain.
Sign
From: Nicolin Chen
To prepare for IOMMUFD_OBJ_HWPT_NESTED, derive struct iommufd_hwpt_paging
from struct iommufd_hw_pagetable, by leaving the common members in struct
iommufd_hw_pagetable. Add a __iommufd_object_alloc and to_hwpt_paging()
helpers for the new structure.
Then, update "hwpt" to "hw
From: Nicolin Chen
Allow iommufd_hwpt_alloc() to have a common routine but jump to different
allocators corresponding to different user input pt_obj types, either an
IOMMUFD_OBJ_IOAS for a PAGING hwpt or an IOMMUFD_OBJ_HWPT_PAGING as the
parent for a NESTED hwpt.
Also, move the "flags" validatio
From: Nicolin Chen
Wrap up the data type/pointer/len sanity and a copy_struct_from_user call
for iommu drivers to copy driver specific data via struct iommu_user_data.
And expect it to be used in the domain_alloc_user op for example.
Signed-off-by: Nicolin Chen
Co-developed-by: Yi Liu
Signed-o
From: Nicolin Chen
IOMMU_HWPT_ALLOC already supports iommu_domain allocation for usersapce.
But it can only allocate a hw_pagetable that associates to a given IOAS,
i.e. only a kernel-managed hw_pagetable of IOMMUFD_OBJ_HWPT_PAGING type.
IOMMU drivers can now support user-managed hw_pagetables,
From: Jason Gunthorpe
Some of the configurations during the attach/replace() should only apply
to IOMMUFD_OBJ_HWPT_PAGING. Once IOMMUFD_OBJ_HWPT_NESTED gets introduced
in a following patch, keeping them unconditionally in the common routine
will not work.
Wrap all of those PAGING-only configurat
From: Nicolin Chen
The IOMMU_HWPT_ALLOC ioctl now supports passing user_data to allocate a
user-managed domain for nested HWPTs. Add its coverage for that. Also,
update _test_cmd_hwpt_alloc() and add test_cmd/err_hwpt_alloc_nested().
Signed-off-by: Nicolin Chen
Signed-off-by: Yi Liu
---
tools
domain_alloc_user op already accepts user flags for domain allocation, add
a parent domain pointer and a driver specific user data support as well.
Add a struct iommu_user_data as a bundle of data_ptr/data_len/type from an
iommufd core uAPI structure. Make the user data opaque to the core, since
a
From: Jason Gunthorpe
To add a new IOMMUFD_OBJ_HWPT_NESTED, rename the HWPT object to confine
it to PAGING hwpts/domains. The following patch will separate the hwpt
structure as well.
Signed-off-by: Jason Gunthorpe
Signed-off-by: Nicolin Chen
Signed-off-by: Yi Liu
---
drivers/iommu/iommufd/d
From: Lu Baolu
Introduce a new domain type for a user I/O page table, which is nested on
top of another user space address represented by a PAGING domain. This
new domain can be allocated by the domain_alloc_user op, and attached to
a device through the existing iommu_attach_device/group() interf
Nested translation is a hardware feature that is supported by many modern
IOMMU hardwares. It has two stages of address translations to get access
to the physical address. A stage-1 translation table is owned by userspace
(e.g. by a guest OS), while a stage-2 is owned by kernel. Any change to a
sta
This adds the scalable mode check before allocating the nested parent domain
as checking nested capability is not enough. User may turn off scalable mode
which also means no nested support even if the hardware supports it.
Fixes: c97d1b20d383 ("iommu/vt-d: Add domain_alloc_user op")
Signed-off-by:
On Tue, Oct 24, 2023 at 7:27 AM David Hildenbrand wrote:
>
> On 23.10.23 20:56, Suren Baghdasaryan wrote:
> > On Mon, Oct 23, 2023 at 5:29 AM David Hildenbrand wrote:
> >>
> >> Focusing on validate_remap_areas():
> >>
> >>> +
> >>> +static int validate_remap_areas(struct vm_area_struct *src_vma,
On 23.10.23 20:56, Suren Baghdasaryan wrote:
On Mon, Oct 23, 2023 at 5:29 AM David Hildenbrand wrote:
Focusing on validate_remap_areas():
+
+static int validate_remap_areas(struct vm_area_struct *src_vma,
+ struct vm_area_struct *dst_vma)
+{
+ /* Only allow re
On Wed, Sep 20, 2023 at 10:49:03AM +0200, Maxime Ripard wrote:
> Kunit recently gained support to setup attributes, the first one being
> the speed of a given test, then allowing to filter out slow tests.
>
> A slow test is defined in the documentation as taking more than one
> second. There's an
On 06/10/2023 11:07, Muhammad Usama Anjum wrote:
> Remove duplicate defines which are already defined in kernel headers and
> re-definition isn't required.
>
> Signed-off-by: Muhammad Usama Anjum
> ---
Hi Muhammad,
Currently when building kselftest against next-master with arm64 arch
and def
> The problem you seem to have with fully locked mseal() in chrome seems
> to be here:
>
> > about permission changes but sometimes we do need to mprotect data only
> > pages.
>
> Does that data have to be in the same region? Can your allocator not
> put the non-code pieces of the JIT elsewhere, w
To select test to run -t parameter can be used. However, -t cat
currently maps to L3 CAT test which is confusing after L2 CAT test is
be the next change.
Allow selecting tests as groups and call L3 CAT test L3_CAT, "CAT"
group will enable to both L3 and L2 CAT tests.
Signed-off-by: Ilpo Järvinen
CAT selftests only cover L3 but some newer CPUs come also with L2 CAT
support.
Add L2 CAT selftest. As measuring L2 misses is not easily available
with perf, use L3 accesses as a proxy for L2 CAT working or not.
Signed-off-by: Ilpo Järvinen
---
tools/testing/selftests/resctrl/cat_test.c| 68
L2 CAT test with low number of bits tends to occasionally fail because
of what seems random variation. The margin is quite small to begin with
for <= 2 bits in CBM. At times, the result can even become negative.
While it would be possible to allow negative values for those cases, it
would be more c
Resource id is acquired differently depending on CPU. AMD tests use id
from L3 cache, whereas CPUs from other vendors base the id on topology
package id. In order to support L2 CAT test, this has to be
generalized.
The driver side code seems to get the resource ids from cache ids so
the approach u
"L2"/"L3" conversion to integer in embedded into get_cache_size()
which prevents reuse.
Create a helper for the cache string to integer conversion to make
it reusable.
Signed-off-by: Ilpo Järvinen
---
tools/testing/selftests/resctrl/resctrlfs.c | 28 +++--
1 file changed, 20 ins
Perf counters are __u64 but the code converts them to unsigned long
before printing them out.
Remove unnecessary type conversion and the potential loss of meaningful
bits due to different sizes of types.
Signed-off-by: Ilpo Järvinen
---
tools/testing/selftests/resctrl/cache.c| 21 --
CAT test spawns two processes into two different control groups with
exclusive schemata. Both the processes alloc a buffer from memory
matching their allocated LLC block size and flush the entire buffer out
of caches. Since the processes are reading through the buffer only once
during the measureme
write_schemata() currently takes the test name as an argument and
determines the relevant resource based on the test name. L2 CAT test
needs to set schemata for both L3 and L2 CAT which would get
complicated using the current approach.
Pass a resource instead of test name to write_schemata() to al
Each test currently has a "run test" function in per test file and
another resctrl_tests.c. The functions in resctrl_tests.c are almost
identical.
Generalize the one in resctrl_tests.c such that it can be shared
between all of the tests. It makes adding new tests easier and removes
the per test if
resctrl_tests reads a set of parameters and passes them individually
for each tests. The way the parameters passed varies between tests.
Add struct input_params to hold are input parameters. It can be easily
passed to every test without varying the call signature.
Signed-off-by: Ilpo Järvinen
--
When reading memory in order, HW prefetching optimizations will
interfere with measuring how caches and memory are being accessed. This
adds noise into the results.
Change the fill_buf reading loop to not use an obvious in-order access
using multiply by a prime and modulo.
Using a prime multiplie
The main CAT test function is called cat_val() and resides in cache.c
which is illogical.
Rename the function to cat_test() and move it into cat_test.c.
Signed-off-by: Ilpo Järvinen
---
tools/testing/selftests/resctrl/cache.c| 90 ++
tools/testing/selftests/resctrl/cat_t
Perf related variables pea_llc_miss, pe_read, and pe_fd are globals in
cache.c.
Convert them to locals for better scoping and make pea_llc_miss simpler
by renaming it to pea. Make close(pe_fd) handling easier to understand
by doing it inside cat_val().
Make also sizeof()s use safer way determine
struct perf_event_attr initialization is spread into
perf_event_initialize() and perf_event_attr_initialize() and setting
->config is hardcoded by the deepest level.
perf_event_attr init belongs to perf_event_attr_initialize() so move it
entirely there. Rename the other function
perf_event_initial
Naming for perf event related functions, types, and variables is
currently inconsistent.
Make struct read_format and all functions related to perf events start
with perf_event. Adjust variable names towards the same direction
but use shorter names for variables where appropriate (pe prefix).
Sign
Perf event handling has functions that are the sole caller of another
perf event handling related function:
- reset_enable_llc_perf() calls perf_event_open_llc_miss()
- reset_enable_llc_perf() calls ioctl_perf_event_ioc_reset_enable()
- measure_llc_perf() calls get_llc_perf()
Remove the extr
show_cache_info() calculates results and provides generic cache
information. This makes it hard to alter pass/fail conditions.
Separate the test specific checks into CAT and CMT test files and
leave only the generic information part into show_cache_info().
Signed-off-by: Ilpo Järvinen
---
tools
The measure_cache_vals() function does a different thing depending on
the test case that called it:
- For CAT, it measures LLC perf misses.
- For CMT, it measures LLC occupancy through resctrl.
Split these two functionalities into own functions the CAT and CMT
tests can call directly.
Co-deve
CAT test doesn't take shareable bits into account, i.e., the test might
be sharing cache with some devices (e.g., graphics).
Introduce get_mask_no_shareable() and use it to provision an
environment for CAT test where the allocated LLC is isolated better.
Excluding shareable_bits may create hole(s)
CAT and CMT tests calculate the span size from the n-bits cache
allocation on their own.
Add cache_size() helper which calculates size of the cache portion for
the given number of bits and use it to replace the existing span
calculations. This also prepares for the new CAT test that will need to
d
get_cache_size() does not modify cache_type so it could be const.
Mark cache_type const so that const char * can be passed to it. This
prevents warnings once many of the test parameters are marked const.
Signed-off-by: Ilpo Järvinen
---
tools/testing/selftests/resctrl/resctrl.h | 2 +-
tools/
Callers of get_cbm_mask() are required to pass a string into which the
CBM bit mask is read. Neither CAT nor CMT tests need the mask as string
but just convert it into an unsigned long value.
The bit mask reader can only read .../cbm_mask files.
Generalize the bit mask reading function into get_b
There are unnecessary nested calls in fill_buf.c:
- run_fill_buf() calls fill_cache()
- alloc_buffer() calls malloc_and_init_memory()
Simplify the code flow and remove those unnecessary call levels by
moving the called code inside the calling function.
Resolve the difference in run_fill_buf()
MBM, MBA and CMT test cases use run_fill_buf() to loop indefinitely
around the buffer. CAT test case is different and doesn't want to loop
around the buffer continuously.
Split fill_cache() so that both the use cases are easier to control by
creating separate functions for buffer allocation and lo
Hi all,
Here's a series to improve resctrl selftests. It contains following
improvements:
- Excludes shareable bits from CAT test allocation to avoid interference
- Alters read pattern to defeat HW prefetcher optimizations
- Rewrites CAT test to make the CAT test reliable and truly measure
if C
96 matches
Mail list logo