Re: [RFC PATCH v2 7/8] mseal:Check seal flag for mmap(2)

2023-10-18 Thread Jeff Xu
Hi Linus, On Tue, Oct 17, 2023 at 10:43 AM Linus Torvalds wrote: > > On Tue, 17 Oct 2023 at 10:04, Linus Torvalds > wrote: > > > > Honestly, there is only two kinds of sealing that makes sense: > > > > - you cannot change the permissions of some area > > > > - you cannot unmap an area > > Actu

Re: [PATCH] kunit: run test suites only after module initialization completes

2023-10-18 Thread kernel test robot
rnel.org/r/20231016203548.21993-1-marpagan%40redhat.com patch subject: [PATCH] kunit: run test suites only after module initialization completes config: csky-randconfig-002-20231018 (https://download.01.org/0day-ci/archive/20231018/202310181220.us7bvp16-...@intel.com/config) compiler: csky-linux-gcc (GCC) 13.2.0

[PATCH v2 1/1] selftests/resctrl: Fix MBM test failure when MBA unavailable

2023-10-18 Thread Ilpo Järvinen
Commit 20d96b25cc4c ("selftests/resctrl: Fix schemata write error check") exposed a problem in feature detection logic in MBM selftest. If schemata does not support MB:x=x entries, the schemata write to initialize 100% memory bandwidth allocation in mbm_setup() will now fail with -EINVAL due to the

Re: [PATCH v2 1/1] selftests/resctrl: Fix MBM test failure when MBA unavailable

2023-10-18 Thread Ilpo Järvinen
On Wed, 18 Oct 2023, Ilpo Järvinen wrote: > Commit 20d96b25cc4c ("selftests/resctrl: Fix schemata write error > check") exposed a problem in feature detection logic in MBM selftest. > If schemata does not support MB:x=x entries, the schemata write to > initialize 100% memory bandwidth allocation i

Re: [PATCH-cgroup 1/4] workqueue: Add workqueue_unbound_exclude_cpumask() to exclude CPUs from wq_unbound_cpumask

2023-10-18 Thread Tejun Heo
Hello, On Fri, Oct 13, 2023 at 02:11:19PM -0400, Waiman Long wrote: > When the "isolcpus" boot command line option is used to add a set > of isolated CPUs, those CPUs will be excluded automatically from > wq_unbound_cpumask to avoid running work functions from unbound > workqueues. > > Recently c

Re: [PATCH-cgroup 3/4] cgroup/cpuset: Keep track of CPUs in isolated partitions

2023-10-18 Thread Tejun Heo
On Fri, Oct 13, 2023 at 02:11:21PM -0400, Waiman Long wrote: ... > @@ -3875,6 +3931,13 @@ static struct cftype dfl_files[] = { > .flags = CFTYPE_ONLY_ON_ROOT | CFTYPE_DEBUG, > }, > > + { > + .name = "cpus.isolated", > + .seq_show = cpuset_common_seq

Re: [PATCH-cgroup 3/4] cgroup/cpuset: Keep track of CPUs in isolated partitions

2023-10-18 Thread Waiman Long
On 10/18/23 05:26, Tejun Heo wrote: On Fri, Oct 13, 2023 at 02:11:21PM -0400, Waiman Long wrote: ... @@ -3875,6 +3931,13 @@ static struct cftype dfl_files[] = { .flags = CFTYPE_ONLY_ON_ROOT | CFTYPE_DEBUG, }, + { + .name = "cpus.isolated", +

Re: [PATCH-cgroup 1/4] workqueue: Add workqueue_unbound_exclude_cpumask() to exclude CPUs from wq_unbound_cpumask

2023-10-18 Thread Waiman Long
On 10/18/23 05:24, Tejun Heo wrote: Hello, On Fri, Oct 13, 2023 at 02:11:19PM -0400, Waiman Long wrote: When the "isolcpus" boot command line option is used to add a set of isolated CPUs, those CPUs will be excluded automatically from wq_unbound_cpumask to avoid running work functions from unbo

[PATCH v5 2/2] selftests/ftrace: Add new test case which checks non unique symbol

2023-10-18 Thread Francis Laniel
If name_show() is non unique, this test will try to install a kprobe on this function which should fail returning EADDRNOTAVAIL. On kernel where name_show() is not unique, this test is skipped. Signed-off-by: Francis Laniel --- .../ftrace/test.d/kprobe/kprobe_non_uniq_symbol.tc | 13 +++

Re: [RFC PATCH v2 5/8] mseal: Check seal flag for munmap(2)

2023-10-18 Thread Jeff Xu
On Tue, Oct 17, 2023 at 9:54 AM Linus Torvalds wrote: > > On Tue, 17 Oct 2023 at 02:08, wrote: > > > > Of all the call paths that call into do_vmi_munmap(), > > this is the only place where checkSeals = MM_SEAL_MUNMAP. > > The rest has checkSeals = 0. > > Why? > > None of this makes sense. > > So

Re: [RFC PATCH v1 0/8] Introduce mseal() syscall

2023-10-18 Thread Matthew Wilcox
On Tue, Oct 17, 2023 at 08:18:47PM -0700, Jeff Xu wrote: > In practice: libc could do below: > #define MM_IMMUTABLE > (MM_SEAL_MPROTECT|MM_SEAL_MUNMAP|MM_SEAL_MREMAP|MM_SEAL_MMAP) > mseal(add,len, MM_IMMUTABLE) > it will be equivalent to BSD's immutable(). No, it wouldn't, because you've carefully

Re: [PATCH v4 01/17] iommu: Add hwpt_type with user_data for domain_alloc_user op

2023-10-18 Thread Jason Gunthorpe
On Mon, Oct 16, 2023 at 11:17:56AM -0700, Nicolin Chen wrote: > On Mon, Oct 16, 2023 at 08:54:07AM -0300, Jason Gunthorpe wrote: > > On Mon, Oct 16, 2023 at 11:28:15AM +0800, Yi Liu wrote: > > > On 2023/10/14 01:56, Nicolin Chen wrote: > > > > On Fri, Oct 13, 2023 at 11:04:56AM -0300, Jason Gunthor

Re: [PATCH v4 08/17] iommufd: Always setup MSI and anforce cc on kernel-managed domains

2023-10-18 Thread Jason Gunthorpe
On Tue, Oct 17, 2023 at 12:58:39PM -0700, Nicolin Chen wrote: > On Tue, Oct 17, 2023 at 12:53:01PM -0300, Jason Gunthorpe wrote: > > On Tue, Oct 17, 2023 at 08:52:49AM +, Tian, Kevin wrote: > > > I prefer to removing enforce_cc in attach fn completely then no parent > > > trick in this patch. J

Re: [PATCH v4 01/17] iommu: Add hwpt_type with user_data for domain_alloc_user op

2023-10-18 Thread Nicolin Chen
On Wed, Oct 18, 2023 at 01:37:20PM -0300, Jason Gunthorpe wrote: > On Mon, Oct 16, 2023 at 11:17:56AM -0700, Nicolin Chen wrote: > > On Mon, Oct 16, 2023 at 08:54:07AM -0300, Jason Gunthorpe wrote: > > > On Mon, Oct 16, 2023 at 11:28:15AM +0800, Yi Liu wrote: > > > > On 2023/10/14 01:56, Nicolin Ch

Re: [PATCH v5 2/2] selftests/ftrace: Add new test case which checks non unique symbol

2023-10-18 Thread Greg KH
On Wed, Oct 18, 2023 at 05:40:30PM +0300, Francis Laniel wrote: > If name_show() is non unique, this test will try to install a kprobe on this > function which should fail returning EADDRNOTAVAIL. > On kernel where name_show() is not unique, this test is skipped. > > Signed-off-by: Francis Laniel

Re: [RFC PATCH v2 5/8] mseal: Check seal flag for munmap(2)

2023-10-18 Thread Jeff Xu
On Wed, Oct 18, 2023 at 8:08 AM Jeff Xu wrote: > > On Tue, Oct 17, 2023 at 9:54 AM Linus Torvalds > wrote: > > > > On Tue, 17 Oct 2023 at 02:08, wrote: > > > > > > Of all the call paths that call into do_vmi_munmap(), > > > this is the only place where checkSeals = MM_SEAL_MUNMAP. > > > The rest

Re: [PATCH-cgroup 3/4] cgroup/cpuset: Keep track of CPUs in isolated partitions

2023-10-18 Thread Tejun Heo
On Wed, Oct 18, 2023 at 09:30:04AM -0400, Waiman Long wrote: > On 10/18/23 05:26, Tejun Heo wrote: > > On Fri, Oct 13, 2023 at 02:11:21PM -0400, Waiman Long wrote: > > ... > > > @@ -3875,6 +3931,13 @@ static struct cftype dfl_files[] = { > > > .flags = CFTYPE_ONLY_ON_ROOT | CFTYPE

Re: [RFC PATCH v1 0/8] Introduce mseal() syscall

2023-10-18 Thread Jeff Xu
On Tue, Oct 17, 2023 at 3:35 PM Pedro Falcato wrote: > > > > > > > I think it's worth pointing out that this suggestion (with PROT_*) > > > could easily integrate with mmap() and as such allow for one-shot > > > mmap() + mseal(). > > > If we consider the common case as 'addr = mmap(...); mseal(add

Re: [PATCH-cgroup 3/4] cgroup/cpuset: Keep track of CPUs in isolated partitions

2023-10-18 Thread Waiman Long
On 10/18/23 14:08, Tejun Heo wrote: On Wed, Oct 18, 2023 at 09:30:04AM -0400, Waiman Long wrote: On 10/18/23 05:26, Tejun Heo wrote: On Fri, Oct 13, 2023 at 02:11:21PM -0400, Waiman Long wrote: ... @@ -3875,6 +3931,13 @@ static struct cftype dfl_files[] = { .flags = CFTYPE_ONLY

Re: [RFC PATCH v2 5/8] mseal: Check seal flag for munmap(2)

2023-10-18 Thread Linus Torvalds
On Wed, 18 Oct 2023 at 10:14, Jeff Xu wrote: > > There is also alternative approach: > > For all the places that call do_vmi_munmap(), find out which > case should ignore the sealing flag legitimately, NO. Christ. THERE ARE NO LEGITIMATE CASES OF IGNORING SEALING FLAGS. If you ignore a sealing

Re: [RFC PATCH v1 0/8] Introduce mseal() syscall

2023-10-18 Thread Jeff Xu
On Wed, Oct 18, 2023 at 8:17 AM Matthew Wilcox wrote: > > Let's start with the purpose. The point of mimmutable/mseal/whatever is > to fix the mapping of an address range to its underlying object, be it > a particular file mapping or anonymous memory. After the call succeeds, > it must not be po

Re: [PATCH] selftests/clone3: Report descriptive test names

2023-10-18 Thread Shuah Khan
On 10/17/23 17:01, Mark Brown wrote: The clone3() selftests currently report test results in a format that does not mesh entirely well with automation. They log output for each test such as: # [1382411] Trying clone3() with flags 0 (size 0) # I am the parent (1382411). My child's pid is 13

Re: [PATCH v2 1/1] selftests/resctrl: Fix MBM test failure when MBA unavailable

2023-10-18 Thread Shuah Khan
On 10/18/23 02:10, Ilpo Järvinen wrote: On Wed, 18 Oct 2023, Ilpo Järvinen wrote: Commit 20d96b25cc4c ("selftests/resctrl: Fix schemata write error check") exposed a problem in feature detection logic in MBM selftest. If schemata does not support MB:x=x entries, the schemata write to initialize

Re: [RFC PATCH v2 5/8] mseal: Check seal flag for munmap(2)

2023-10-18 Thread Jeff Xu
On Wed, Oct 18, 2023 at 11:27 AM Linus Torvalds wrote: > > On Wed, 18 Oct 2023 at 10:14, Jeff Xu wrote: > This is simply not up for discussion. Any flag for "ignore sealing" is wrong. > > We do have one special "unmap" case, namely "unmap_vmas()' called at > last mmput() -> __mmput() -> exit_mmap

Re: [PATCH] selftests/efivarfs: create-read: fix a resource leak

2023-10-18 Thread Shuah Khan
On 10/17/23 19:59, zhujun2 wrote: The opened file should be closed in main(), otherwise resource leak will occur that this problem was discovered by code reading Signed-off-by: zhujun2 --- tools/testing/selftests/efivarfs/create-read.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/to

Re: [PATCH] selftests:modify the incorrect print format

2023-10-18 Thread Shuah Khan
On 10/17/23 09:54, Shuah Khan wrote: On 10/16/23 20:08, zhujun2 wrote: when the argument type is 'unsigned int',printf '%u' in format string Please add how you found the problem to the commit log. Signed-off-by: zhujun2 thanks, -- Shuah Applied to linux-kselftest next for Linux 6.7-rc

Re: [PATCH v2] selftests: futex: remove duplicate unneeded defines

2023-10-18 Thread Shuah Khan
On 10/16/23 15:43, Peter Zijlstra wrote: On Mon, Oct 16, 2023 at 01:21:20PM -0600, Shuah Khan wrote: On 10/6/23 03:55, Muhammad Usama Anjum wrote: Kselftests are kernel tests and must be build with kernel headers from same source version. The kernel headers are already being included correctly

Re: [RESEND PATCH 0/2] add loongarch and riscv support for kprobe args test

2023-10-18 Thread Shuah
On 10/17/23 20:08, Yu Liao wrote: Yu Liao (2): selftests/ftrace: add loongarch support for kprobe args char tests selftests/ftrace: Add riscv support for kprobe arg tests .../selftests/ftrace/test.d/kprobe/kprobe_args_char.tc | 6 ++ .../selftests/ftrace/test.d/kprobe/kprobe_ar

Re: [PATCH-cgroup 1/4] workqueue: Add workqueue_unbound_exclude_cpumask() to exclude CPUs from wq_unbound_cpumask

2023-10-18 Thread Waiman Long
On 10/18/23 09:41, Waiman Long wrote: On 10/18/23 05:24, Tejun Heo wrote: Hello, On Fri, Oct 13, 2023 at 02:11:19PM -0400, Waiman Long wrote: When the "isolcpus" boot command line option is used to add a set of isolated CPUs, those CPUs will be excluded automatically from wq_unbound_cpumask to

Re: [PATCH 1/1] selftests: KVM: add test to print boottime wallclock

2023-10-18 Thread Sean Christopherson
On Fri, Oct 06, 2023, Dongli Zhang wrote: > As inspired by the discussion in [1], the boottime wallclock may drift due > to the fact that the masterclock (or host monotonic clock) and kvmclock are > calculated based on the algorithms in different domains. > > This is to introduce a testcase to pri

Re: [RFC PATCH v1 0/8] Introduce mseal() syscall

2023-10-18 Thread Theo de Raadt
Jeff Xu wrote: > On Wed, Oct 18, 2023 at 8:17 AM Matthew Wilcox wrote: > > > > Let's start with the purpose. The point of mimmutable/mseal/whatever is > > to fix the mapping of an address range to its underlying object, be it > > a particular file mapping or anonymous memory. After the call su

Re: [PATCH] kunit: run test suites only after module initialization completes

2023-10-18 Thread kernel test robot
Hi Marco, kernel test robot noticed the following build errors: [auto build test ERROR on linus/master] [also build test ERROR on v6.6-rc6 next-20231018] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as doc

Re: [PATCH v3 1/5] mm: list_lru: allow external numa node and cgroup tracking

2023-10-18 Thread Yosry Ahmed
On Tue, Oct 17, 2023 at 4:21 PM Nhat Pham wrote: > > The interface of list_lru is based on the assumption that objects are > allocated on the correct node/memcg, with this change it is introduced the > possibility to explicitly specify numa node and memcgroup when adding and > removing objects. Th

Re: [PATCH v3 1/5] mm: list_lru: allow external numa node and cgroup tracking

2023-10-18 Thread Nhat Pham
On Wed, Oct 18, 2023 at 3:27 PM Yosry Ahmed wrote: > > On Tue, Oct 17, 2023 at 4:21 PM Nhat Pham wrote: > > > > The interface of list_lru is based on the assumption that objects are > > allocated on the correct node/memcg, with this change it is introduced the > > possibility to explicitly specif

Re: [PATCH v3 2/5] zswap: make shrinking memcg-aware

2023-10-18 Thread Yosry Ahmed
On Tue, Oct 17, 2023 at 4:21 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

Re: [PATCH v3 3/5] mm: memcg: add per-memcg zswap writeback stat

2023-10-18 Thread Yosry Ahmed
On Tue, Oct 17, 2023 at 4:21 PM Nhat Pham wrote: > > 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 P

Re: [PATCH v3 5/5] zswap: shrinks zswap pool based on memory pressure

2023-10-18 Thread Yosry Ahmed
On Tue, Oct 17, 2023 at 4:21 PM Nhat Pham wrote: > > 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

Re: [PATCH v3 2/5] zswap: make shrinking memcg-aware

2023-10-18 Thread Nhat Pham
On Wed, Oct 18, 2023 at 4:20 PM Yosry Ahmed wrote: > > On Tue, Oct 17, 2023 at 4:21 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 > > determi

Re: [PATCH v3 2/5] zswap: make shrinking memcg-aware

2023-10-18 Thread Nhat Pham
On Wed, Oct 18, 2023 at 4:46 PM Nhat Pham wrote: > > On Wed, Oct 18, 2023 at 4:20 PM Yosry Ahmed wrote: > > > > On Tue, Oct 17, 2023 at 4:21 PM Nhat Pham wrote: > > > > > > From: Domenico Cerasuolo > > > > > > Currently, we only have a single global LRU for zswap. This makes it > > > impossible

Re: [PATCH v3 3/5] mm: memcg: add per-memcg zswap writeback stat

2023-10-18 Thread Nhat Pham
On Wed, Oct 18, 2023 at 4:25 PM Yosry Ahmed wrote: > > On Tue, Oct 17, 2023 at 4:21 PM Nhat Pham wrote: > > > > 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: N

Re: [PATCH v3 2/5] zswap: make shrinking memcg-aware

2023-10-18 Thread Yosry Ahmed
On Wed, Oct 18, 2023 at 4:47 PM Nhat Pham wrote: > > On Wed, Oct 18, 2023 at 4:20 PM Yosry Ahmed wrote: > > > > On Tue, Oct 17, 2023 at 4:21 PM Nhat Pham wrote: > > > > > > From: Domenico Cerasuolo > > > > > > Currently, we only have a single global LRU for zswap. This makes it > > > impossible

[PATCH] selftests:modify the incorrect print format

2023-10-18 Thread zhujun2
when the argument type is 'unsigned int',printf '%u' in format string that this problem was discovered by code reading Signed-off-by: zhujun2 --- tools/testing/selftests/kselftest.h | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tools/testing/selftests/kselft

RE: [PATCH v4 08/17] iommufd: Always setup MSI and anforce cc on kernel-managed domains

2023-10-18 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Thursday, October 19, 2023 12:51 AM > > On Tue, Oct 17, 2023 at 12:58:39PM -0700, Nicolin Chen wrote: > > On Tue, Oct 17, 2023 at 12:53:01PM -0300, Jason Gunthorpe wrote: > > > On Tue, Oct 17, 2023 at 08:52:49AM +, Tian, Kevin wrote: > > > > I prefer to removin

Re: [PATCH 1/1] selftests: KVM: add test to print boottime wallclock

2023-10-18 Thread Andrew Jones
On Wed, Oct 18, 2023 at 12:51:55PM -0700, Sean Christopherson wrote: > On Fri, Oct 06, 2023, Dongli Zhang wrote: > > As inspired by the discussion in [1], the boottime wallclock may drift due > > to the fact that the masterclock (or host monotonic clock) and kvmclock are > > calculated based on the