[PATCH 4/4] Documentation/x86: Add ratelimit in buslock.rst

2021-04-19 Thread Fenghua Yu
ratelimit is a new option in bus lock handling. Need to add it in buslock.rst. Signed-off-by: Fenghua Yu Reviewed-by: Tony Luck --- Documentation/x86/buslock.rst | 23 +++ 1 file changed, 23 insertions(+) diff --git a/Documentation/x86/buslock.rst b/Documentation/x86

[PATCH 3/4] Documentation/admin-guide: Change doc for bus lock ratelimit

2021-04-19 Thread Fenghua Yu
Since bus lock rate limit changes the split_lock_detect parameter, update the documentation for the change. Signed-off-by: Fenghua Yu Reviewed-by: Tony Luck --- Documentation/admin-guide/kernel-parameters.txt | 8 1 file changed, 8 insertions(+) diff --git a/Documentation/admin-guide

[PATCH 2/4] x86/bus_lock: Set rate limit for bus lock

2021-04-19 Thread Fenghua Yu
system rate of bus locks drops below the threshold. Signed-off-by: Fenghua Yu Reviewed-by: Tony Luck --- arch/x86/kernel/cpu/intel.c | 43 +++-- 1 file changed, 41 insertions(+), 2 deletions(-) diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c

[PATCH 1/4] Documentation/x86: Add buslock.rst

2021-04-19 Thread Fenghua Yu
Add buslock.rst to explain bus lock problem and how to detect and handle it. Signed-off-by: Fenghua Yu Reviewed-by: Tony Luck --- Documentation/x86/buslock.rst | 110 ++ 1 file changed, 110 insertions(+) create mode 100644 Documentation/x86/buslock.rst diff

[PATCH 0/4] x86/bus_lock: Set rate limit for bus lock

2021-04-19 Thread Fenghua Yu
bus lock into warn and fatal patch set and this rate limit patch set: https://lore.kernel.org/lkml/871rca6dbp@nanos.tec.linutronix.de/ Fenghua Yu (4): Documentation/x86: Add buslock.rst x86/bus_lock: Set rate limit for bus lock Documentation/admin-guide: Change doc for bus lock ratelimit

Re: [PATCH v5 2/3] x86/bus_lock: Handle #DB for bus lock

2021-04-13 Thread Fenghua Yu
Hi, Thomas, On Mon, Apr 12, 2021 at 09:15:08AM +0200, Thomas Gleixner wrote: > On Sat, Apr 03 2021 at 01:04, Fenghua Yu wrote: > > On Sat, Mar 20, 2021 at 01:42:52PM +0100, Thomas Gleixner wrote: > >> On Fri, Mar 19 2021 at 22:19, Fenghua Yu wrote: > >> And even with th

Re: [PATCH v2] selftests/resctrl: Change a few printed messages

2021-04-07 Thread Fenghua Yu
Hi, Shuah, On Wed, Apr 07, 2021 at 04:46:38PM -0600, Shuah Khan wrote: > On 4/7/21 1:57 PM, Fenghua Yu wrote: > > Change a few printed messages to report test progress more clearly. > Thank you. Applied to linux-kseftest next branch for 5.13-rc1 Great! I pull the next patch and te

[PATCH v2] selftests/resctrl: Change a few printed messages

2021-04-07 Thread Fenghua Yu
Change a few printed messages to report test progress more clearly. Add a missing "\n" at the end of one printed message. Suggested-by: Shuah Khan Signed-off-by: Fenghua Yu --- Change log: v2: - Add "Pass:" and "Fail:" sub-strings back (Shuah). This is a fol

Re: [PATCH] selftests/resctrl: Change a few printed messages

2021-04-07 Thread Fenghua Yu
Hi, Shuah, On Wed, Apr 07, 2021 at 08:33:23AM -0600, Shuah Khan wrote: > On 4/5/21 6:52 PM, Fenghua Yu wrote: > > - ksft_print_msg("%s cache miss rate within %d%%\n", > > - ret ? "Fail:" : "Pass:", max_diff_percent); > > +

[PATCH] selftests/resctrl: Change a few printed messages

2021-04-05 Thread Fenghua Yu
A few printed messages contain pass/fail strings which should be shown in test results. Remove the pass/fail strings in the messages to avoid confusion. Add "\n" at the end of one printed message. Suggested-by: Shuah Khan Signed-off-by: Fenghua Yu --- This is a follow-up patch

Re: [PATCH v5 2/3] x86/bus_lock: Handle #DB for bus lock

2021-04-02 Thread Fenghua Yu
Hi, Thomas, On Sat, Mar 20, 2021 at 01:42:52PM +0100, Thomas Gleixner wrote: > On Fri, Mar 19 2021 at 22:19, Fenghua Yu wrote: > > On Fri, Mar 19, 2021 at 10:30:50PM +0100, Thomas Gleixner wrote: > >> > +if (sscanf(arg, "ratelimit:%d",

Re: [PATCH v5 2/3] x86/bus_lock: Handle #DB for bus lock

2021-04-02 Thread Fenghua Yu
Hi, Thomas, On Sat, Mar 20, 2021 at 02:57:52PM +0100, Thomas Gleixner wrote: > On Sat, Mar 20 2021 at 02:01, Thomas Gleixner wrote: > > > On Fri, Mar 19 2021 at 21:50, Tony Luck wrote: > >>> What is the justifucation for making this rate limit per UID and not > >>> per task, per process or

Re: [PATCH v6 00/21] Miscellaneous fixes for resctrl selftests

2021-04-02 Thread Fenghua Yu
On Fri, Apr 02, 2021 at 02:04:16PM -0600, Shuah Khan wrote: > On 4/2/21 12:18 PM, Fenghua Yu wrote: > > Hi, Shuah, > > > > On Fri, Apr 02, 2021 at 12:17:17PM -0600, Shuah Khan wrote: > > > On 3/26/21 1:45 PM, Fenghua Yu wrote: > > > > Hi, Shuah, > >

Re: [PATCH v6 00/21] Miscellaneous fixes for resctrl selftests

2021-04-02 Thread Fenghua Yu
Hi, Shuah, On Fri, Apr 02, 2021 at 12:17:17PM -0600, Shuah Khan wrote: > On 3/26/21 1:45 PM, Fenghua Yu wrote: > > Hi, Shuah, > > > > On Wed, Mar 17, 2021 at 02:22:34AM +, Fenghua Yu wrote: > > > This patch set has several miscellaneous fixes to resctrl selft

[tip: x86/splitlock] Documentation/admin-guide: Change doc for split_lock_detect parameter

2021-03-28 Thread tip-bot2 for Fenghua Yu
The following commit has been merged into the x86/splitlock branch of tip: Commit-ID: ebca17707e38f2050b188d837bd4646b29a1b0c2 Gitweb: https://git.kernel.org/tip/ebca17707e38f2050b188d837bd4646b29a1b0c2 Author:Fenghua Yu AuthorDate:Mon, 22 Mar 2021 13:53:25 Committer

[tip: x86/splitlock] x86/traps: Handle #DB for bus lock

2021-03-28 Thread tip-bot2 for Fenghua Yu
The following commit has been merged into the x86/splitlock branch of tip: Commit-ID: ebb1064e7c2e90b56e4d40ab154ef9796060a1c3 Gitweb: https://git.kernel.org/tip/ebb1064e7c2e90b56e4d40ab154ef9796060a1c3 Author:Fenghua Yu AuthorDate:Mon, 22 Mar 2021 13:53:24 Committer

[tip: x86/splitlock] x86/cpufeatures: Enumerate #DB for bus lock detection

2021-03-28 Thread tip-bot2 for Fenghua Yu
The following commit has been merged into the x86/splitlock branch of tip: Commit-ID: f21d4d3b97a8603567e5d4250bd75e8ebbd520af Gitweb: https://git.kernel.org/tip/f21d4d3b97a8603567e5d4250bd75e8ebbd520af Author:Fenghua Yu AuthorDate:Mon, 22 Mar 2021 13:53:23 Committer

Re: [PATCH v6 00/21] Miscellaneous fixes for resctrl selftests

2021-03-26 Thread Fenghua Yu
Hi, Shuah, On Wed, Mar 17, 2021 at 02:22:34AM +, Fenghua Yu wrote: > This patch set has several miscellaneous fixes to resctrl selftest tool > that are easily visible to user. V1 had fixes to CAT test and CMT test > but they were dropped in V2 because having them here made the

[PATCH v6 0/3] x86/bus_lock: Enable bus lock detection

2021-03-22 Thread Fenghua Yu
8460-1-git-send-email-fenghua...@intel.com/] Fenghua Yu (3): x86/cpufeatures: Enumerate #DB for bus lock detection x86/bus_lock: Handle #DB for bus lock Documentation/admin-guide: Change doc for split_lock_detect parameter .../admin-guide/kernel-parameters.txt | 22 +++

[PATCH v6 3/3] Documentation/admin-guide: Change doc for split_lock_detect parameter

2021-03-22 Thread Fenghua Yu
Since #DB for bus lock detect changes the split_lock_detect parameter, update the documentation for the changes. Signed-off-by: Fenghua Yu Reviewed-by: Tony Luck Acked-by: Randy Dunlap --- Change Log: v6: - Remove the ratelimit info which will be released later in a ratelimit specific patch

[PATCH v6 1/3] x86/cpufeatures: Enumerate #DB for bus lock detection

2021-03-22 Thread Fenghua Yu
r's choice. The CPU feature flag to be shown in /proc/cpuinfo will be "bus_lock_detect". Signed-off-by: Fenghua Yu Reviewed-by: Tony Luck --- Change Log: v6: - Fix wording issues in the commit message (Thomas). v5: - Add "Both breakpoint and bus lock can trigger an #DB trap..

[PATCH v6 2/3] x86/bus_lock: Handle #DB for bus lock

2021-03-22 Thread Fenghua Yu
s lock in userspace clears DR6[11]. To avoid confusion in identifying #DB, #DB handler sets the bit to 1 before returning to the interrupted task. Signed-off-by: Fenghua Yu Reviewed-by: Tony Luck --- Change Log: v6: - Split the v5 patch set into two patch sets: the one for warn and fatal and the one

Re: [PATCH v5 2/3] x86/bus_lock: Handle #DB for bus lock

2021-03-19 Thread Fenghua Yu
Hi, Thomas, On Fri, Mar 19, 2021 at 10:30:50PM +0100, Thomas Gleixner wrote: > On Sat, Mar 13 2021 at 05:49, Fenghua Yu wrote: > > Change Log: > > v5: > > Address all comments from Thomas: > > - Merge patch 2 and patch 3 into one patch so all "split_lock_dete

Re: [PATCH v5 1/3] x86/cpufeatures: Enumerate #DB for bus lock detection

2021-03-19 Thread Fenghua Yu
On Fri, Mar 19, 2021 at 09:35:39PM +0100, Thomas Gleixner wrote: > On Sat, Mar 13 2021 at 05:49, Fenghua Yu wrote: > > A bus lock is acquired though either split locked access to > > s/though/through/ > either a > > Some CPUs have ability to notify the kernel by

[PATCH v6 21/21] selftests/resctrl: Create .gitignore to include resctrl_tests

2021-03-16 Thread Fenghua Yu
Create .gitignore to hold the test file resctrl_tests generated after compiling. Suggested-by: Shuah Khan Tested-by: Babu Moger Signed-off-by: Fenghua Yu --- Change Log: v5: - Add this patch (Shuah) tools/testing/selftests/resctrl/.gitignore | 2 ++ 1 file changed, 2 insertions(+) create

[PATCH v6 16/21] selftests/resctrl: Modularize resctrl test suite main() function

2021-03-16 Thread Fenghua Yu
() function. Adding these wrapper functions makes it easier to add any logic to each individual test. Please note that this is a preparatory patch for the next one and no functional changes are intended. Suggested-by: Reinette Chatre Tested-by: Babu Moger Signed-off-by: Fenghua Yu

[PATCH v6 20/21] selftests/resctrl: Fix checking for < 0 for unsigned values

2021-03-16 Thread Fenghua Yu
-by: Babu Moger Signed-off-by: Fenghua Yu --- tools/testing/selftests/resctrl/resctrl_val.c | 41 +++ 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/tools/testing/selftests/resctrl/resctrl_val.c b/tools/testing/selftests/resctrl/resctrl_val.c index 20d457c47de

[PATCH v6 15/21] selftests/resctrl: Don't hard code value of "no_of_bits" variable

2021-03-16 Thread Fenghua Yu
no_of_bits is equal to half of the maximum number of bits in the cbm mask. Please note that CMT test is still hard coded to 5 bits. It will change in subsequent patches that change CMT test. Tested-by: Babu Moger Signed-off-by: Fenghua Yu --- tools/testing/selftests/resctrl/cat_test.

[PATCH v6 14/21] selftests/resctrl: Fix MBA/MBM results reporting format

2021-03-16 Thread Fenghua Yu
value is within 5% (randomly chosen value) of imc_mbm value. If the difference is greater than 5% of imc_mbm value, treat it is a failure. Tested-by: Babu Moger Signed-off-by: Fenghua Yu --- tools/testing/selftests/resctrl/mba_test.c | 22 +- tools/testing/selftests/resctrl

[PATCH v6 17/21] selftests/resctrl: Skip the test if requested resctrl feature is not supported

2021-03-16 Thread Fenghua Yu
s disabled Suggested-by: Reinette Chatre Tested-by: Babu Moger Signed-off-by: Fenghua Yu --- Change Log: v6: - Replace "cat" by CAT_STR and so on (Babu). tools/testing/selftests/resctrl/cat_test.c| 3 --- tools/testing/selftests/resctrl/mba_test.c| 3 --- tools/testing/selftest

[PATCH v6 03/21] selftests/resctrl: Fix compilation issues for other global variables

2021-03-16 Thread Fenghua Yu
these variables are defined globally in two .c files but are not declared as extern. To fix issues for the global variables, declare them as extern. Chang Log: - Split this patch from v4's patch 1 (Shuah). Reported-by: Reinette Chatre Tested-by: Babu Moger Signed-off-by: Fenghua Yu --- tools/testing

[PATCH v6 19/21] selftests/resctrl: Fix incorrect parsing of iMC counters

2021-03-16 Thread Fenghua Yu
presents an iMC counter, else, skip the directory. Reported-by: Reinette Chatre Tested-by: Babu Moger Signed-off-by: Fenghua Yu --- tools/testing/selftests/resctrl/resctrl_val.c | 22 +-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/tools/testing/selfte

[PATCH v6 18/21] selftests/resctrl: Fix unmount resctrl FS

2021-03-16 Thread Fenghua Yu
resctrl FS to check if mba is enabled on the platform or not and finds that the H/W doesn't support mba and hence will return false to run_mba_test(). This in turn makes the main() function return without unmounting resctrl FS. Tested-by: Babu Moger Signed-off-by: Fenghua Yu --- tools/testing

[PATCH v6 02/21] selftests/resctrl: Fix compilation issues for global variables

2021-03-16 Thread Fenghua Yu
. Reported-by: Reinette Chatre Tested-by: Babu Moger Signed-off-by: Fenghua Yu --- Change Log: v5: - Define long_mask, cbm_mask, count_of_bits etc as static variables (Shuah). - Split this patch into patch 2 and 3 (Shuah). tools/testing/selftests/resctrl/cat_test.c | 10 +- tools

[PATCH v6 05/21] selftests/resctrl: Ensure sibling CPU is not same as original CPU

2021-03-16 Thread Fenghua Yu
selection by taking the provided/default CPU into account and ensuring a sibling that is a different CPU is selected. Tested-by: Babu Moger Signed-off-by: Reinette Chatre Signed-off-by: Fenghua Yu --- Change Log: v5: - Move from v4's patch 8 to this patch as the fix patch should be first (S

[PATCH v6 06/21] selftests/resctrl: Fix missing options "-n" and "-p"

2021-03-16 Thread Fenghua Yu
-off-by: Fenghua Yu --- Change Log: v5: - Move from v4's patch 9 to this patch as the fix patch should be first (Shuah). tools/testing/selftests/resctrl/resctrl_tests.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/resctrl/resctrl_tests.c b/tools

[PATCH v6 04/21] selftests/resctrl: Clean up resctrl features check

2021-03-16 Thread Fenghua Yu
ested-by: Babu Moger Signed-off-by: Fenghua Yu --- Change Log: v5: - Remove is_cat() etc functions and directly call strncmp() to check the features (Shuah). tools/testing/selftests/resctrl/cache.c | 8 +++ tools/testing/selftests/resctrl/cat_test.c| 2 +- tools/testing/selftest

[PATCH v6 11/21] selftests/resctrl: Add config dependencies

2021-03-16 Thread Fenghua Yu
Add the config file for test dependencies. Suggested-by: Shuah Khan Tested-by: Babu Moger Signed-off-by: Fenghua Yu --- Change Log: v5: - Add this patch (Shuah) tools/testing/selftests/resctrl/config | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 tools/testing/selftests/resctrl

[PATCH v6 07/21] selftests/resctrl: Rename CQM test as CMT test

2021-03-16 Thread Fenghua Yu
Suggested-by: Reinette Chatre Tested-by: Babu Moger Signed-off-by: Fenghua Yu --- tools/testing/selftests/resctrl/README| 4 +-- tools/testing/selftests/resctrl/cache.c | 4 +-- .../resctrl/{cqm_test.c => cmt_test.c}| 20 +++--- tools/testing/selftests/resctrl/resct

[PATCH v6 09/21] selftests/resctrl: Share show_cache_info() by CAT and CMT tests

2021-03-16 Thread Fenghua Yu
show_cache_info() functions are defined separately in CAT and CMT tests. But the functions are same for the tests and unnecessary to be defined separately. Share the function by the tests. Suggested-by: Shuah Khan Tested-by: Babu Moger Signed-off-by: Fenghua Yu --- Change Log: v5: - Add

[PATCH v6 12/21] selftests/resctrl: Check for resctrl mount point only if resctrl FS is supported

2021-03-16 Thread Fenghua Yu
at /proc/mounts Steps 2 and 3 will fail if the platform does not support resctrl file system. So, there is no need to check for them if step 1 fails. Fix this by returning immediately if the platform does not support resctrl file system. Tested-by: Babu Moger Signed-off-by: Fenghua Yu

[PATCH v6 08/21] selftests/resctrl: Call kselftest APIs to log test results

2021-03-16 Thread Fenghua Yu
Call kselftest APIs instead of using printf() to log test results for cleaner code and better future extension. Suggested-by: Shuah Khan Tested-by: Babu Moger Signed-off-by: Fenghua Yu --- Change Log: v6: - Capitalize the first letter in printed msg (Babu). v5: - Add this patch (Shuah

[PATCH v6 01/21] selftests/resctrl: Enable gcc checks to detect buffer overflows

2021-03-16 Thread Fenghua Yu
and enable _FORTIFY_SOURCE gcc check to catch any future buffer overflow errors. Reported-by: David Binderman Suggested-by: David Binderman Tested-by: Babu Moger Signed-off-by: Fenghua Yu --- Change Log: v5: - Move from v4's patch 11 to patch 1 so the fix patch should be first (Shuah). tools/testing

[PATCH v6 10/21] selftests/resctrl: Fix a printed message

2021-03-16 Thread Fenghua Yu
From: Reinette Chatre Add a missing newline to the printed help text to improve readability. Tested-by: Babu Moger Signed-off-by: Reinette Chatre Signed-off-by: Fenghua Yu --- Change Log: v5: - Remove the "notok" fix part because the API change fixes it already. tools/testing

[PATCH v6 00/21] Miscellaneous fixes for resctrl selftests

2021-03-16 Thread Fenghua Yu
t/cover.1589835155.git.sai.praneeth.prak...@intel.com/] v2: 1. Dropped changes to CAT test and CMT test as they will be posted in a later series. 2. Added several other fixes [v1: https://lore.kernel.org/linux-kselftest/cover.1583657204.git.sai.praneeth.prak...@intel.com/] Fenghua Yu (19): selftests/res

[PATCH v6 13/21] selftests/resctrl: Use resctrl/info for feature detection

2021-03-16 Thread Fenghua Yu
mbm__bytes Please note that only L3_CAT, L3_CMT, MBA and MBM are supported. CDP and L2 variants can be added later. Reported-by: Reinette Chatre Tested-by: Babu Moger Signed-off-by: Fenghua Yu --- tools/testing/selftests/resctrl/resctrl.h | 6 ++- tools/testing/selftests/resctrl/resctrlfs.c

[PATCH v5 0/3] x86/bus_lock: Enable bus lock detection

2021-03-12 Thread Fenghua Yu
https://lore.kernel.org/lkml/1595021700-68460-1-git-send-email-fenghua...@intel.com/] Fenghua Yu (3): x86/cpufeatures: Enumerate #DB for bus lock detection x86/bus_lock: Handle #DB for bus lock Documentation/admin-guide: Change doc for split_lock_detect parameter .../admin-guide/kernel

[PATCH v5 2/3] x86/bus_lock: Handle #DB for bus lock

2021-03-12 Thread Fenghua Yu
s lock in userspace clears DR6[11]. To avoid confusion in identifying #DB, #DB handler sets the bit to 1 before returning to the interrupted task. Signed-off-by: Fenghua Yu Reviewed-by: Tony Luck --- Change Log: v5: Address all comments from Thomas: - Merge patch 2 and patch 3 into one patch so a

[PATCH v5 3/3] Documentation/admin-guide: Change doc for split_lock_detect parameter

2021-03-12 Thread Fenghua Yu
Since #DB for bus lock detect changes the split_lock_detect parameter, update the documentation for the changes. Signed-off-by: Fenghua Yu Reviewed-by: Tony Luck Acked-by: Randy Dunlap --- Change Log: v5: - Remove N < HZ/2 check info in the doc (Thomas). v4: - Fix a ratelimit wording is

[PATCH v5 1/3] x86/cpufeatures: Enumerate #DB for bus lock detection

2021-03-12 Thread Fenghua Yu
ice. The CPU feature flag to be shown in /proc/cpuinfo will be "bus_lock_detect". Signed-off-by: Fenghua Yu Reviewed-by: Tony Luck --- Change Log: v5: - Add "Both breakpoint and bus lock can trigger an #DB trap..." in the commit message (Thomas). arch/x86/include/asm/cpuf

Re: [PATCH v5 00/21] Miscellaneous fixes for resctrl selftests

2021-03-12 Thread Fenghua Yu
Hi, Babu, On Fri, Mar 12, 2021 at 01:08:11PM -0600, Babu Moger wrote: > Hi Fenghua, Thanks for the patches. > Sanity tested them on AMD systems. Appears to work fine. > Few minor comments in few patches. > Tested-by: Babu Moger I will add Tested-by: Babu Moger in the series and address your

Re: [PATCH v5 08/21] selftests/resctrl: Call kselftest APIs to log test results

2021-03-12 Thread Fenghua Yu
Hi, Babu, On Fri, Mar 12, 2021 at 01:12:35PM -0600, Babu Moger wrote: > > - printf("# dmesg: %s", line); > > + ksft_print_msg("dmesg: %s", line); > > if (strstr(line, "resctrl:")) > > - printf("# dmesg: %s", line); > > +

Re: [PATCH v5 04/21] selftests/resctrl: Clean up resctrl features check

2021-03-12 Thread Fenghua Yu
Hi, Babu, On Fri, Mar 12, 2021 at 01:09:50PM -0600, Babu Moger wrote: > > - if (strcmp(resctrl_val, "mba") == 0) > > + if (!strncmp(resctrl_val, MBA_STR, sizeof(MBA_STR))) > > sprintf(schema, "%s%d%c%s", "MB:", resource_id, '=', > > schemata); > I see there are few other

Re: [PATCH v5 02/21] selftests/resctrl: Fix compilation issues for global variables

2021-03-12 Thread Fenghua Yu
Hi, Babu, On Fri, Mar 12, 2021 at 01:08:31PM -0600, Babu Moger wrote: > > From: Fenghua Yu > > Taking a closer look at the usage of these variables reveals that these > > variables are used only locally to functions such as cqm_resctrl_val() > > %s/ locally to functions/

[PATCH v5 11/21] selftests/resctrl: Add config dependencies

2021-03-07 Thread Fenghua Yu
Add the config file for test dependencies. Suggested-by: Shuah Khan Signed-off-by: Fenghua Yu --- Change Log: v5: - Add this patch (Shuah) tools/testing/selftests/resctrl/config | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 tools/testing/selftests/resctrl/config diff --git

[PATCH v5 18/21] selftests/resctrl: Fix unmount resctrl FS

2021-03-07 Thread Fenghua Yu
resctrl FS to check if mba is enabled on the platform or not and finds that the H/W doesn't support mba and hence will return false to run_mba_test(). This in turn makes the main() function return without unmounting resctrl FS. Signed-off-by: Fenghua Yu --- tools/testing/selftests/resctrl

[PATCH v5 16/21] selftests/resctrl: Modularize resctrl test suite main() function

2021-03-07 Thread Fenghua Yu
() function. Adding these wrapper functions makes it easier to add any logic to each individual test. Please note that this is a preparatory patch for the next one and no functional changes are intended. Suggested-by: Reinette Chatre Signed-off-by: Fenghua Yu --- .../testing/selftests/resctrl

[PATCH v5 14/21] selftests/resctrl: Fix MBA/MBM results reporting format

2021-03-07 Thread Fenghua Yu
value is within 5% (randomly chosen value) of imc_mbm value. If the difference is greater than 5% of imc_mbm value, treat it is a failure. Signed-off-by: Fenghua Yu --- tools/testing/selftests/resctrl/mba_test.c | 22 +- tools/testing/selftests/resctrl/mbm_test.c | 15

[PATCH v5 15/21] selftests/resctrl: Don't hard code value of "no_of_bits" variable

2021-03-07 Thread Fenghua Yu
no_of_bits is equal to half of the maximum number of bits in the cbm mask. Please note that CMT test is still hard coded to 5 bits. It will change in subsequent patches that change CMT test. Signed-off-by: Fenghua Yu --- tools/testing/selftests/resctrl/cat_test.c | 5 - tools/testing

[PATCH v5 17/21] selftests/resctrl: Skip the test if requested resctrl feature is not supported

2021-03-07 Thread Fenghua Yu
s disabled Suggested-by: Reinette Chatre Signed-off-by: Fenghua Yu --- tools/testing/selftests/resctrl/cat_test.c| 3 --- tools/testing/selftests/resctrl/mba_test.c| 3 --- tools/testing/selftests/resctrl/mbm_test.c| 3 --- .../testing/selftests/resctrl/resctrl_te

[PATCH v5 12/21] selftests/resctrl: Check for resctrl mount point only if resctrl FS is supported

2021-03-07 Thread Fenghua Yu
at /proc/mounts Steps 2 and 3 will fail if the platform does not support resctrl file system. So, there is no need to check for them if step 1 fails. Fix this by returning immediately if the platform does not support resctrl file system. Signed-off-by: Fenghua Yu --- tools/testing/selftests

[PATCH v5 13/21] selftests/resctrl: Use resctrl/info for feature detection

2021-03-07 Thread Fenghua Yu
mbm__bytes Please note that only L3_CAT, L3_CMT, MBA and MBM are supported. CDP and L2 variants can be added later. Reported-by: Reinette Chatre Signed-off-by: Fenghua Yu --- tools/testing/selftests/resctrl/resctrl.h | 6 ++- tools/testing/selftests/resctrl/resctrlfs.c | 52

[PATCH v5 21/21] selftests/resctrl: Create .gitignore to include resctrl_tests

2021-03-07 Thread Fenghua Yu
Create .gitignore to hold the test file resctrl_tests generated after compiling. Suggested-by: Shuah Khan Signed-off-by: Fenghua Yu --- Change Log: v5: - Add this patch (Shuah) tools/testing/selftests/resctrl/.gitignore | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 tools/testing

[PATCH v5 03/21] selftests/resctrl: Fix compilation issues for other global variables

2021-03-07 Thread Fenghua Yu
these variables are defined globally in two .c files but are not declared as extern. To fix issues for the global variables, declare them as extern. Chang Log: - Split this patch from v4's patch 1 (Shuah). Reported-by: Reinette Chatre Signed-off-by: Fenghua Yu --- tools/testing/selftests/resctrl

[PATCH v5 20/21] selftests/resctrl: Fix checking for < 0 for unsigned values

2021-03-07 Thread Fenghua Yu
ter Signed-off-by: Fenghua Yu --- tools/testing/selftests/resctrl/resctrl_val.c | 41 +++ 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/tools/testing/selftests/resctrl/resctrl_val.c b/tools/testing/selftests/resctrl/resctrl_val.c index de99d398ebfb..5a66e94cd4b4 100

[PATCH v5 19/21] selftests/resctrl: Fix incorrect parsing of iMC counters

2021-03-07 Thread Fenghua Yu
presents an iMC counter, else, skip the directory. Reported-by: Reinette Chatre Signed-off-by: Fenghua Yu --- tools/testing/selftests/resctrl/resctrl_val.c | 22 +-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/resctrl/resctrl_val.c b/tool

[PATCH v5 02/21] selftests/resctrl: Fix compilation issues for global variables

2021-03-07 Thread Fenghua Yu
. Reported-by: Reinette Chatre Signed-off-by: Fenghua Yu --- Change Log: v5: - Define long_mask, cbm_mask, count_of_bits etc as static variables (Shuah). - Split this patch into patch 2 and 3 (Shuah). tools/testing/selftests/resctrl/cat_test.c | 10 +- tools/testing/selftests/resctrl

[PATCH v5 04/21] selftests/resctrl: Clean up resctrl features check

2021-03-07 Thread Fenghua Yu
Checking resctrl features call strcmp() to compare feature strings (e.g. "mba", "cat" etc). The checkings are error prone and don't have good coding style. Define the constant strings in macros and call strncmp() to solve the potential issues. Suggested-by: Shuah Khan Signe

[PATCH v5 05/21] selftests/resctrl: Ensure sibling CPU is not same as original CPU

2021-03-07 Thread Fenghua Yu
selection by taking the provided/default CPU into account and ensuring a sibling that is a different CPU is selected. Signed-off-by: Reinette Chatre Signed-off-by: Fenghua Yu --- Change Log: v5: - Move from v4's patch 8 to this patch as the fix patch should be first (Shuah). tools/testing/self

[PATCH v5 09/21] selftests/resctrl: Share show_cache_info() by CAT and CMT tests

2021-03-07 Thread Fenghua Yu
show_cache_info() functions are defined separately in CAT and CMT tests. But the functions are same for the tests and unnecessary to be defined separately. Share the function by the tests. Suggested-by: Shuah Khan Signed-off-by: Fenghua Yu --- Change Log: v5: - Add this patch (Shuah) tools

[PATCH v5 07/21] selftests/resctrl: Rename CQM test as CMT test

2021-03-07 Thread Fenghua Yu
Suggested-by: Reinette Chatre Signed-off-by: Fenghua Yu --- tools/testing/selftests/resctrl/README| 4 +-- tools/testing/selftests/resctrl/cache.c | 4 +-- .../resctrl/{cqm_test.c => cmt_test.c}| 20 +++--- tools/testing/selftests/resctrl/resctrl.h | 6 ++--- .../test

[PATCH v5 06/21] selftests/resctrl: Fix missing options "-n" and "-p"

2021-03-07 Thread Fenghua Yu
as invalid options. Fix this by adding them to the list of characters that getopt() recognizes as valid arguments. Please note that the main() function already has the logic to deal with the values passed as part of these arguments and hence no changes are needed there. Signed-off-by: Fenghua Yu

[PATCH v5 00/21] Miscellaneous fixes for resctrl selftests

2021-03-07 Thread Fenghua Yu
Added several other fixes [v1: https://lore.kernel.org/linux-kselftest/cover.1583657204.git.sai.praneeth.prak...@intel.com/] Fenghua Yu (19): selftests/resctrl: Enable gcc checks to detect buffer overflows selftests/resctrl: Fix compilation issues for global variables selftests/resctrl: Fi

[PATCH v5 10/21] selftests/resctrl: Fix a printed message

2021-03-07 Thread Fenghua Yu
From: Reinette Chatre Add a missing newline to the printed help text to improve readability. Signed-off-by: Reinette Chatre Signed-off-by: Fenghua Yu --- Change Log: v5: - Remove the "notok" fix part because the API change fixes it already. tools/testing/selftests/resctrl/resct

[PATCH v5 01/21] selftests/resctrl: Enable gcc checks to detect buffer overflows

2021-03-07 Thread Fenghua Yu
and enable _FORTIFY_SOURCE gcc check to catch any future buffer overflow errors. Reported-by: David Binderman Suggested-by: David Binderman Signed-off-by: Fenghua Yu --- Change Log: v5: - Move from v4's patch 11 to patch 1 so the fix patch should be first (Shuah). tools/testing/selftests/resctrl/Make

[PATCH v5 08/21] selftests/resctrl: Call kselftest APIs to log test results

2021-03-07 Thread Fenghua Yu
Call kselftest APIs instead of using printf() to log test results for cleaner code and better future extension. Suggested-by: Shuah Khan Signed-off-by: Fenghua Yu --- Change Log: v5: - Add this patch (Shuah) tools/testing/selftests/resctrl/cat_test.c| 37 +++ tools/testing

Re: [PATCH v6 08/12] fork: Clear PASID for new mm

2021-02-25 Thread Fenghua Yu
Hi, Jean, On Wed, Feb 24, 2021 at 11:19:27AM +0100, Jean-Philippe Brucker wrote: > Hi Fenghua, > > [Trimmed the Cc list] > > On Mon, Jul 13, 2020 at 04:48:03PM -0700, Fenghua Yu wrote: > > When a new mm is created, its PASID should be cleared, i.e. the PASID is > > in

[tip: x86/urgent] x86/split_lock: Enable the split lock feature on another Alder Lake CPU

2021-02-01 Thread tip-bot2 for Fenghua Yu
The following commit has been merged into the x86/urgent branch of tip: Commit-ID: 8acf417805a5f5c69e9ff66f14cab022c2755161 Gitweb: https://git.kernel.org/tip/8acf417805a5f5c69e9ff66f14cab022c2755161 Author:Fenghua Yu AuthorDate:Mon, 01 Feb 2021 19:00:07 Committer

[PATCH] x86/split_lock: Enable the split lock feature on another Alder Lake CPU

2021-02-01 Thread Fenghua Yu
Add Alder Lake mobile processor to CPU list to enumerate and enable the split lock feature. Signed-off-by: Fenghua Yu Reviewed-by: Tony Luck --- arch/x86/kernel/cpu/intel.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c index

Re: [PATCH v4 0/4] x86/bus_lock: Enable bus lock detection

2021-01-26 Thread Fenghua Yu
Hi, Dear X86 Maintainers, >On Mon, Jan 04, 2021 at 07:42:28PM +0000, Fenghua Yu wrote: > > On Tue, Nov 24, 2020 at 08:52:41PM +, Fenghua Yu wrote: > > A bus lock [1] is acquired through either split locked access to > > writeback (WB) memory or any locked ac

Re: [PATCH v4 00/17] Miscellaneous fixes for resctrl selftests

2021-01-25 Thread Fenghua Yu
On Mon, Jan 25, 2021 at 02:52:09PM -0700, Shuah Khan wrote: > On 1/25/21 1:47 PM, Fenghua Yu wrote: > > On Mon, Nov 30, 2020 at 08:19:53PM +, Fenghua Yu wrote: > > > This patch set has several miscellaneous fixes to resctrl selftest tool > > > that are easily vi

Re: [PATCH v4 00/17] Miscellaneous fixes for resctrl selftests

2021-01-25 Thread Fenghua Yu
Hi, Shuah, On Mon, Nov 30, 2020 at 08:19:53PM +, Fenghua Yu wrote: > This patch set has several miscellaneous fixes to resctrl selftest tool > that are easily visible to user. V1 had fixes to CAT test and CMT test > but they were dropped in V2 because having them here made the

Re: [PATCH V4] arch: kernel: cpu: x86/resctrl: Takes a letter away and append a colon to match below struct member

2021-01-13 Thread Fenghua Yu
On Wed, Jan 13, 2021 at 07:33:33AM +0530, Bhaskar Chowdhury wrote: > s/kernlfs/kernfs/ > s/@mon_data_kn/@mon_data_kn:/ May change the message to describe the problems like: Fix typo "kernlfs" and add missing ":" to match with other comments. > > Signed-off-by: Bhaskar Chowdhury > --- >

[tip: x86/urgent] x86/resctrl: Use an IPI instead of task_work_add() to update PQR_ASSOC MSR

2021-01-08 Thread tip-bot2 for Fenghua Yu
The following commit has been merged into the x86/urgent branch of tip: Commit-ID: ae28d1aae48a1258bd09a6f707ebb4231d79a761 Gitweb: https://git.kernel.org/tip/ae28d1aae48a1258bd09a6f707ebb4231d79a761 Author:Fenghua Yu AuthorDate:Thu, 17 Dec 2020 14:31:18 -08:00 Committer

[tip: x86/urgent] x86/resctrl: Don't move a task to the same resource group

2021-01-08 Thread tip-bot2 for Fenghua Yu
The following commit has been merged into the x86/urgent branch of tip: Commit-ID: a0195f314a25582b38993bf30db11c300f4f4611 Gitweb: https://git.kernel.org/tip/a0195f314a25582b38993bf30db11c300f4f4611 Author:Fenghua Yu AuthorDate:Thu, 17 Dec 2020 14:31:19 -08:00 Committer

Re: [PATCH v4 0/4] x86/bus_lock: Enable bus lock detection

2021-01-04 Thread Fenghua Yu
Hi, Dear X86 Maintainers, On Tue, Nov 24, 2020 at 08:52:41PM +, Fenghua Yu wrote: > A bus lock [1] is acquired through either split locked access to > writeback (WB) memory or any locked access to non-WB memory. This is > typically >1000 cycles slower than an atomic operation with

[PATCH v4 14/17] selftests/resctrl: Skip the test if requested resctrl feature is not supported

2020-11-30 Thread Fenghua Yu
s disabled Suggested-by: Reinette Chatre Signed-off-by: Fenghua Yu --- tools/testing/selftests/resctrl/cat_test.c| 3 --- tools/testing/selftests/resctrl/mba_test.c| 3 --- tools/testing/selftests/resctrl/mbm_test.c| 3 --- .../testing/selftests/resctrl/resctrl_te

[PATCH v4 13/17] selftests/resctrl: Modularize resctrl test suite main() function

2020-11-30 Thread Fenghua Yu
() function. Adding these wrapper functions makes it easier to add any logic to each individual test. Please note that this is a preparatory patch for the next one and no functional changes are intended. Suggested-by: Reinette Chatre Signed-off-by: Fenghua Yu --- .../testing/selftests/resctrl

[PATCH v4 15/17] selftests/resctrl: Fix unmount resctrl FS

2020-11-30 Thread Fenghua Yu
resctrl FS to check if mba is enabled on the platform or not and finds that the H/W doesn't support mba and hence will return false to run_mba_test(). This in turn makes the main() function return without unmounting resctrl FS. Signed-off-by: Fenghua Yu --- tools/testing/selftests/resctrl

[PATCH v4 12/17] selftests/resctrl: Don't hard code value of "no_of_bits" variable

2020-11-30 Thread Fenghua Yu
no_of_bits is equal to half of the maximum number of bits in the cbm mask. Please note that CMT test is still hard coded to 5 bits. It will change in subsequent patches that change CMT test. Signed-off-by: Fenghua Yu --- tools/testing/selftests/resctrl/cat_test.c | 5 - tools/testing

[PATCH v4 11/17] selftests/resctrl: Enable gcc checks to detect buffer overflows

2020-11-30 Thread Fenghua Yu
and enable _FORTIFY_SOURCE gcc check to catch any future buffer overflow errors. Reported-by: David Binderman Suggested-by: David Binderman Signed-off-by: Fenghua Yu --- tools/testing/selftests/resctrl/Makefile | 2 +- tools/testing/selftests/resctrl/cmt_test.c | 2 +- 2 files changed, 2 insertions(+), 2

[PATCH v4 10/17] selftests/resctrl: Fix MBA/MBM results reporting format

2020-11-30 Thread Fenghua Yu
value is within 5% (randomly chosen value) of imc_mbm value. If the difference is greater than 5% of imc_mbm value, treat it is a failure. Signed-off-by: Fenghua Yu --- tools/testing/selftests/resctrl/mba_test.c | 20 +++- tools/testing/selftests/resctrl/mbm_test.c | 13

[PATCH v4 07/17] selftests/resctrl: Use resctrl/info for feature detection

2020-11-30 Thread Fenghua Yu
mbm__bytes Please note that only L3_CAT, L3_CMT, MBA and MBM are supported. CDP and L2 variants can be added later. Reported-by: Reinette Chatre Signed-off-by: Fenghua Yu --- tools/testing/selftests/resctrl/resctrl.h | 6 ++- tools/testing/selftests/resctrl/resctrlfs.c | 51

[PATCH v4 06/17] selftests/resctrl: Check for resctrl mount point only if resctrl FS is supported

2020-11-30 Thread Fenghua Yu
at /proc/mounts Steps 2 and 3 will fail if the platform does not support resctrl file system. So, there is no need to check for them if step 1 fails. Fix this by returning immediately if the platform does not support resctrl file system. Signed-off-by: Fenghua Yu --- tools/testing/selftests

[PATCH v4 05/17] selftests/resctrl: Add a few dependencies

2020-11-30 Thread Fenghua Yu
't support resctrl file system. Fix this by checking for the return value of check_resctrlfs_support() in the main function. If resctrl file system isn't supported on the platform then exit the test suite gracefully without attempting to run any of resctrl unit tests. Signed-off-by: Fenghua Yu --- too

[PATCH v4 17/17] selftests/resctrl: Fix checking for < 0 for unsigned values

2020-11-30 Thread Fenghua Yu
ter Signed-off-by: Fenghua Yu --- tools/testing/selftests/resctrl/resctrl_val.c | 41 +++ 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/tools/testing/selftests/resctrl/resctrl_val.c b/tools/testing/selftests/resctrl/resctrl_val.c index d6f0688182e8..ce8f0ec15f7b 100

[PATCH v4 02/17] selftests/resctrl: Clean up resctrl features check

2020-11-30 Thread Fenghua Yu
Checking resctrl features call strcmp() to compare feature strings (e.g. "mba", "cat" etc). The checkings are error prone and don't have good coding style. Define the constant strings in macros and call strncmp() to solve the potential issues. Suggested-by: Shuah Khan Signe

[PATCH v4 00/17] Miscellaneous fixes for resctrl selftests

2020-11-30 Thread Fenghua Yu
https://lore.kernel.org/linux-kselftest/cover.1583657204.git.sai.praneeth.prak...@intel.com/] Fenghua Yu (15): selftests/resctrl: Fix compilation issues for global variables selftests/resctrl: Clean up resctrl features check selftests/resctrl: Rename CQM test as CMT test selftests/resctrl: Add

[PATCH v4 16/17] selftests/resctrl: Fix incorrect parsing of iMC counters

2020-11-30 Thread Fenghua Yu
presents an iMC counter, else, skip the directory. Reported-by: Reinette Chatre Signed-off-by: Fenghua Yu --- tools/testing/selftests/resctrl/resctrl_val.c | 22 +-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/resctrl/resctrl_val.c b/tool

[PATCH v4 01/17] selftests/resctrl: Fix compilation issues for global variables

2020-11-30 Thread Fenghua Yu
to the functions where they are used. To fix issues for other global variables (e.g: bm_pid, ppid, llc_occup_path and is_amd) that are used across .c files, declare them as extern. Reported-by: Reinette Chatre Signed-off-by: Fenghua Yu --- tools/testing/selftests/resctrl/cat_test.c | 12

  1   2   3   4   5   6   7   8   9   10   >