Re: [dm-devel] [PATCH v4 7/7] block: Inline blk_mq_{, delay_}kick_requeue_list()

2023-06-22 Thread Christoph Hellwig
On Wed, Jun 21, 2023 at 01:12:34PM -0700, Bart Van Assche wrote: > Patch "block: Preserve the order of requeued requests" changed > blk_mq_kick_requeue_list() and blk_mq_delay_kick_requeue_list() into > blk_mq_run_hw_queues() and blk_mq_delay_run_hw_queues() calls > respectively. Inline

[dm-devel] [PATCH 20/29] zsmalloc: dynamically allocate the mm-zspool shrinker

2023-06-22 Thread Qi Zheng
In preparation for implementing lockless slab shrink, we need to dynamically allocate the mm-zspool shrinker, so that it can be freed asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU read-side critical section when releasing the struct zs_pool. Signed-off-by: Qi Zheng ---

[dm-devel] [PATCH 10/29] vmw_balloon: dynamically allocate the vmw-balloon shrinker

2023-06-22 Thread Qi Zheng
In preparation for implementing lockless slab shrink, we need to dynamically allocate the vmw-balloon shrinker, so that it can be freed asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU read-side critical section when releasing the struct vmballoon. Signed-off-by: Qi Zheng

Re: [dm-devel] [PATCH 24/29] mm: vmscan: make global slab shrink lockless

2023-06-22 Thread Vlastimil Babka
On 6/22/23 10:53, Qi Zheng wrote: > The shrinker_rwsem is a global read-write lock in > shrinkers subsystem, which protects most operations > such as slab shrink, registration and unregistration > of shrinkers, etc. This can easily cause problems in > the following cases. > > 1) When the memory

[dm-devel] [PATCH 12/29] mbcache: dynamically allocate the mbcache shrinker

2023-06-22 Thread Qi Zheng
In preparation for implementing lockless slab shrink, we need to dynamically allocate the mbcache shrinker, so that it can be freed asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU read-side critical section when releasing the struct mb_cache. Signed-off-by: Qi Zheng ---

Re: [dm-devel] [PATCH 29/29] mm: shrinker: move shrinker-related code into a separate file

2023-06-22 Thread Vlastimil Babka
On 6/22/23 10:53, Qi Zheng wrote: > The mm/vmscan.c file is too large, so separate the shrinker-related > code from it into a separate file. No functional changes. > > Signed-off-by: Qi Zheng Maybe do this move as patch 01 so the further changes are done in the new file already? -- dm-devel

[dm-devel] [PATCH 05/29] drm/panfrost: dynamically allocate the drm-panfrost shrinker

2023-06-22 Thread Qi Zheng
In preparation for implementing lockless slab shrink, we need to dynamically allocate the drm-panfrost shrinker, so that it can be freed asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU read-side critical section when releasing the struct panfrost_device. Signed-off-by: Qi

[dm-devel] [PATCH 10/29] vmw_balloon: dynamically allocate the vmw-balloon shrinker

2023-06-22 Thread Qi Zheng
From: Qi Zheng In preparation for implementing lockless slab shrink, we need to dynamically allocate the vmw-balloon shrinker, so that it can be freed asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU read-side critical section when releasing the struct vmballoon.

[dm-devel] [PATCH 11/29] virtio_balloon: dynamically allocate the virtio-balloon shrinker

2023-06-22 Thread Qi Zheng
In preparation for implementing lockless slab shrink, we need to dynamically allocate the virtio-balloon shrinker, so that it can be freed asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU read-side critical section when releasing the struct virtio_balloon. Signed-off-by: Qi

[dm-devel] [PATCH 04/29] drm/msm: dynamically allocate the drm-msm_gem shrinker

2023-06-22 Thread Qi Zheng
From: Qi Zheng In preparation for implementing lockless slab shrink, we need to dynamically allocate the drm-msm_gem shrinker, so that it can be freed asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU read-side critical section when releasing the struct msm_drm_private.

[dm-devel] [PATCH 26/29] mm: shrinker: make count and scan in shrinker debugfs lockless

2023-06-22 Thread Qi Zheng
Like global and memcg slab shrink, also make count and scan operations in memory shrinker debugfs lockless. The debugfs_remove_recursive() will wait for debugfs_file_put() to return, so there is no need to call rcu_read_lock() before calling shrinker_try_get(). Signed-off-by: Qi Zheng ---

Re: [dm-devel] [PATCH v4 7/7] block: Inline blk_mq_{, delay_}kick_requeue_list()

2023-06-22 Thread Roger Pau Monné
On Wed, Jun 21, 2023 at 01:12:34PM -0700, Bart Van Assche wrote: > Patch "block: Preserve the order of requeued requests" changed > blk_mq_kick_requeue_list() and blk_mq_delay_kick_requeue_list() into > blk_mq_run_hw_queues() and blk_mq_delay_run_hw_queues() calls > respectively. Inline

[dm-devel] [PATCH 02/29] mm: vmscan: introduce some helpers for dynamically allocating shrinker

2023-06-22 Thread Qi Zheng
From: Qi Zheng Introduce some helpers for dynamically allocating shrinker instance, and their uses are as follows: 1. shrinker_alloc_and_init() Used to allocate and initialize a shrinker instance, the priv_data parameter is used to pass the pointer of the previously embedded structure of the

Re: [dm-devel] [PATCH 24/29] mm: vmscan: make global slab shrink lockless

2023-06-22 Thread Qi Zheng
On 2023/6/22 23:12, Vlastimil Babka wrote: On 6/22/23 10:53, Qi Zheng wrote: The shrinker_rwsem is a global read-write lock in shrinkers subsystem, which protects most operations such as slab shrink, registration and unregistration of shrinkers, etc. This can easily cause problems in the

[dm-devel] [PATCH 17/29] xfs: dynamically allocate the xfs-buf shrinker

2023-06-22 Thread Qi Zheng
In preparation for implementing lockless slab shrink, we need to dynamically allocate the xfs-buf shrinker, so that it can be freed asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU read-side critical section when releasing the struct xfs_buftarg. Signed-off-by: Qi Zheng ---

[dm-devel] [PATCH 16/29] NFSD: dynamically allocate the nfsd-reply shrinker

2023-06-22 Thread Qi Zheng
In preparation for implementing lockless slab shrink, we need to dynamically allocate the nfsd-reply shrinker, so that it can be freed asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU read-side critical section when releasing the struct nfsd_net. Signed-off-by: Qi Zheng ---

[dm-devel] [PATCH 28/29] mm: shrinkers: convert shrinker_rwsem to mutex

2023-06-22 Thread Qi Zheng
Now there are no readers of shrinker_rwsem, so we can simply replace it with mutex lock. Signed-off-by: Qi Zheng --- drivers/md/dm-cache-metadata.c | 2 +- drivers/md/dm-thin-metadata.c | 2 +- fs/super.c | 2 +- mm/shrinker_debug.c| 14 +++---

[dm-devel] [PATCH 08/29] md/raid5: dynamically allocate the md-raid5 shrinker

2023-06-22 Thread Qi Zheng
In preparation for implementing lockless slab shrink, we need to dynamically allocate the md-raid5 shrinker, so that it can be freed asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU read-side critical section when releasing the struct r5conf. Signed-off-by: Qi Zheng ---

[dm-devel] [PATCH 01/29] mm: shrinker: add shrinker::private_data field

2023-06-22 Thread Qi Zheng
From: Qi Zheng To prepare for the dynamic allocation of shrinker instances embedded in other structures, add a private_data field to struct shrinker, so that we can use shrinker::private_data to record and get the original embedded structure. Signed-off-by: Qi Zheng ---

[dm-devel] [PATCH 11/29] virtio_balloon: dynamically allocate the virtio-balloon shrinker

2023-06-22 Thread Qi Zheng
From: Qi Zheng In preparation for implementing lockless slab shrink, we need to dynamically allocate the virtio-balloon shrinker, so that it can be freed asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU read-side critical section when releasing the struct virtio_balloon.

[dm-devel] [PATCH 22/29] drm/ttm: introduce pool_shrink_rwsem

2023-06-22 Thread Qi Zheng
Currently, the synchronize_shrinkers() is only used by TTM pool. It only requires that no shrinkers run in parallel. After we use RCU+refcount method to implement the lockless slab shrink, we can not use shrinker_rwsem or synchronize_rcu() to guarantee that all shrinker invocations have seen an

[dm-devel] [PATCH 01/29] mm: shrinker: add shrinker::private_data field

2023-06-22 Thread Qi Zheng
To prepare for the dynamic allocation of shrinker instances embedded in other structures, add a private_data field to struct shrinker, so that we can use shrinker::private_data to record and get the original embedded structure. Signed-off-by: Qi Zheng --- include/linux/shrinker.h | 2 ++ 1 file

[dm-devel] [PATCH 02/29] mm: vmscan: introduce some helpers for dynamically allocating shrinker

2023-06-22 Thread Qi Zheng
From: Qi Zheng Introduce some helpers for dynamically allocating shrinker instance, and their uses are as follows: 1. shrinker_alloc_and_init() Used to allocate and initialize a shrinker instance, the priv_data parameter is used to pass the pointer of the previously embedded structure of the

[dm-devel] [PATCH 29/29] mm: shrinker: move shrinker-related code into a separate file

2023-06-22 Thread Qi Zheng
The mm/vmscan.c file is too large, so separate the shrinker-related code from it into a separate file. No functional changes. Signed-off-by: Qi Zheng --- include/linux/shrinker.h | 3 + mm/Makefile | 4 +- mm/shrinker.c| 750 +++

[dm-devel] [PATCH 07/29] dm zoned: dynamically allocate the dm-zoned-meta shrinker

2023-06-22 Thread Qi Zheng
In preparation for implementing lockless slab shrink, we need to dynamically allocate the dm-zoned-meta shrinker, so that it can be freed asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU read-side critical section when releasing the struct dmz_metadata. Signed-off-by: Qi

[dm-devel] [PATCH 19/29] xfs: dynamically allocate the xfs-qm shrinker

2023-06-22 Thread Qi Zheng
In preparation for implementing lockless slab shrink, we need to dynamically allocate the xfs-qm shrinker, so that it can be freed asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU read-side critical section when releasing the struct xfs_quotainfo. Signed-off-by: Qi Zheng

[dm-devel] [PATCH 01/29] mm: shrinker: add shrinker::private_data field

2023-06-22 Thread Qi Zheng
From: Qi Zheng To prepare for the dynamic allocation of shrinker instances embedded in other structures, add a private_data field to struct shrinker, so that we can use shrinker::private_data to record and get the original embedded structure. Signed-off-by: Qi Zheng ---

[dm-devel] [PATCH 03/29] drm/i915: dynamically allocate the i915_gem_mm shrinker

2023-06-22 Thread Qi Zheng
In preparation for implementing lockless slab shrink, we need to dynamically allocate the i915_gem_mm shrinker, so that it can be freed asynchronously by using kfree_rcu(). Then it doesn't need to wait for RCU read-side critical section when releasing the struct drm_i915_private. Signed-off-by:

[dm-devel] [PATCH 25/29] mm: vmscan: make memcg slab shrink lockless

2023-06-22 Thread Qi Zheng
Like global slab shrink, this commit also uses refcount+RCU method to make memcg slab shrink lockless. We can reproduce the down_read_trylock() hotspot through the following script: ``` DIR="/root/shrinker/memcg/mnt" do_create() { mkdir -p /sys/fs/cgroup/memory/test mkdir -p

[dm-devel] [PATCH 21/29] fs: super: dynamically allocate the s_shrink

2023-06-22 Thread Qi Zheng
In preparation for implementing lockless slab shrink, we need to dynamically allocate the s_shrink, so that it can be freed asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU read-side critical section when releasing the struct super_block. Signed-off-by: Qi Zheng ---

[dm-devel] [PATCH 23/29] mm: shrinker: add refcount and completion_wait fields

2023-06-22 Thread Qi Zheng
This commit introduces refcount and completion_wait fields to struct shrinker to manage the life cycle of shrinker instance. Just a preparation work for implementing the lockless slab shrink, no functional changes. Signed-off-by: Qi Zheng --- include/linux/shrinker.h | 11 +++

[dm-devel] [PATCH 03/29] drm/i915: dynamically allocate the i915_gem_mm shrinker

2023-06-22 Thread Qi Zheng
From: Qi Zheng In preparation for implementing lockless slab shrink, we need to dynamically allocate the i915_gem_mm shrinker, so that it can be freed asynchronously by using kfree_rcu(). Then it doesn't need to wait for RCU read-side critical section when releasing the struct drm_i915_private.

[dm-devel] [PATCH 04/29] drm/msm: dynamically allocate the drm-msm_gem shrinker

2023-06-22 Thread Qi Zheng
In preparation for implementing lockless slab shrink, we need to dynamically allocate the drm-msm_gem shrinker, so that it can be freed asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU read-side critical section when releasing the struct msm_drm_private. Signed-off-by: Qi

Re: [dm-devel] [PATCH 24/29] mm: vmscan: make global slab shrink lockless

2023-06-22 Thread Alan Huang
> 2023年6月23日 上午12:42,Qi Zheng 写道: > > > > On 2023/6/22 23:12, Vlastimil Babka wrote: >> On 6/22/23 10:53, Qi Zheng wrote: >>> The shrinker_rwsem is a global read-write lock in >>> shrinkers subsystem, which protects most operations >>> such as slab shrink, registration and unregistration >>>

[dm-devel] [PATCH 02/29] mm: vmscan: introduce some helpers for dynamically allocating shrinker

2023-06-22 Thread Qi Zheng
Introduce some helpers for dynamically allocating shrinker instance, and their uses are as follows: 1. shrinker_alloc_and_init() Used to allocate and initialize a shrinker instance, the priv_data parameter is used to pass the pointer of the previously embedded structure of the shrinker instance.

[dm-devel] [PATCH 24/29] mm: vmscan: make global slab shrink lockless

2023-06-22 Thread Qi Zheng
The shrinker_rwsem is a global read-write lock in shrinkers subsystem, which protects most operations such as slab shrink, registration and unregistration of shrinkers, etc. This can easily cause problems in the following cases. 1) When the memory pressure is high and there are many

[dm-devel] [PATCH 09/29] bcache: dynamically allocate the md-bcache shrinker

2023-06-22 Thread Qi Zheng
In preparation for implementing lockless slab shrink, we need to dynamically allocate the md-bcache shrinker, so that it can be freed asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU read-side critical section when releasing the struct cache_set. Signed-off-by: Qi Zheng ---

[dm-devel] [PATCH 08/29] md/raid5: dynamically allocate the md-raid5 shrinker

2023-06-22 Thread Qi Zheng
From: Qi Zheng In preparation for implementing lockless slab shrink, we need to dynamically allocate the md-raid5 shrinker, so that it can be freed asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU read-side critical section when releasing the struct r5conf. Signed-off-by:

[dm-devel] [PATCH 14/29] jbd2, ext4: dynamically allocate the jbd2-journal shrinker

2023-06-22 Thread Qi Zheng
From: Qi Zheng In preparation for implementing lockless slab shrink, we need to dynamically allocate the jbd2-journal shrinker, so that it can be freed asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU read-side critical section when releasing the struct journal_s.

[dm-devel] [PATCH 15/29] NFSD: dynamically allocate the nfsd-client shrinker

2023-06-22 Thread Qi Zheng
In preparation for implementing lockless slab shrink, we need to dynamically allocate the nfsd-client shrinker, so that it can be freed asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU read-side critical section when releasing the struct nfsd_net. Signed-off-by: Qi Zheng

[dm-devel] [PATCH 07/29] dm zoned: dynamically allocate the dm-zoned-meta shrinker

2023-06-22 Thread Qi Zheng
From: Qi Zheng In preparation for implementing lockless slab shrink, we need to dynamically allocate the dm-zoned-meta shrinker, so that it can be freed asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU read-side critical section when releasing the struct dmz_metadata.

[dm-devel] [PATCH 06/29] dm: dynamically allocate the dm-bufio shrinker

2023-06-22 Thread Qi Zheng
In preparation for implementing lockless slab shrink, we need to dynamically allocate the dm-bufio shrinker, so that it can be freed asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU read-side critical section when releasing the struct dm_bufio_client. Signed-off-by: Qi Zheng

[dm-devel] [PATCH 27/29] mm: vmscan: hold write lock to reparent shrinker nr_deferred

2023-06-22 Thread Qi Zheng
For now, reparent_shrinker_deferred() is the only holder of read lock of shrinker_rwsem. And it already holds the global cgroup_mutex, so it will not be called in parallel. Therefore, in order to convert shrinker_rwsem to shrinker_mutex later, here we change to hold the write lock of

[dm-devel] [PATCH 00/29] use refcount+RCU method to implement lockless slab shrink

2023-06-22 Thread Qi Zheng
From: Qi Zheng Hi all, 1. Background = We used to implement the lockless slab shrink with SRCU [1], but then kernel test robot reported -88.8% regression in stress-ng.ramfs.ops_per_sec test case [2], so we reverted it [3]. This patch series aims to re-implement the lockless slab

[dm-devel] [PATCH 09/29] bcache: dynamically allocate the md-bcache shrinker

2023-06-22 Thread Qi Zheng
From: Qi Zheng In preparation for implementing lockless slab shrink, we need to dynamically allocate the md-bcache shrinker, so that it can be freed asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU read-side critical section when releasing the struct cache_set.

[dm-devel] [PATCH 14/29] jbd2, ext4: dynamically allocate the jbd2-journal shrinker

2023-06-22 Thread Qi Zheng
In preparation for implementing lockless slab shrink, we need to dynamically allocate the jbd2-journal shrinker, so that it can be freed asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU read-side critical section when releasing the struct journal_s. Signed-off-by: Qi Zheng

Re: [dm-devel] [PATCH 24/29] mm: vmscan: make global slab shrink lockless

2023-06-22 Thread Qi Zheng
On 2023/6/23 01:41, Alan Huang wrote: 2023年6月23日 上午12:42,Qi Zheng 写道: On 2023/6/22 23:12, Vlastimil Babka wrote: On 6/22/23 10:53, Qi Zheng wrote: The shrinker_rwsem is a global read-write lock in shrinkers subsystem, which protects most operations such as slab shrink, registration and

[dm-devel] [PATCH 18/29] xfs: dynamically allocate the xfs-inodegc shrinker

2023-06-22 Thread Qi Zheng
In preparation for implementing lockless slab shrink, we need to dynamically allocate the xfs-inodegc shrinker, so that it can be freed asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU read-side critical section when releasing the struct xfs_mount. Signed-off-by: Qi Zheng

[dm-devel] [PATCH 06/29] dm: dynamically allocate the dm-bufio shrinker

2023-06-22 Thread Qi Zheng
From: Qi Zheng In preparation for implementing lockless slab shrink, we need to dynamically allocate the dm-bufio shrinker, so that it can be freed asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU read-side critical section when releasing the struct dm_bufio_client.

Re: [dm-devel] [PATCH 01/29] mm: shrinker: add shrinker::private_data field

2023-06-22 Thread Vlastimil Babka
On 6/22/23 10:53, Qi Zheng wrote: > To prepare for the dynamic allocation of shrinker instances > embedded in other structures, add a private_data field to > struct shrinker, so that we can use shrinker::private_data > to record and get the original embedded structure. > > Signed-off-by: Qi Zheng

[dm-devel] [PATCH 05/29] drm/panfrost: dynamically allocate the drm-panfrost shrinker

2023-06-22 Thread Qi Zheng
From: Qi Zheng In preparation for implementing lockless slab shrink, we need to dynamically allocate the drm-panfrost shrinker, so that it can be freed asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU read-side critical section when releasing the struct panfrost_device.

[dm-devel] [PATCH 00/29] use refcount+RCU method to implement lockless slab shrink

2023-06-22 Thread Qi Zheng
From: Qi Zheng Hi all, 1. Background = We used to implement the lockless slab shrink with SRCU [1], but then kernel test robot reported -88.8% regression in stress-ng.ramfs.ops_per_sec test case [2], so we reverted it [3]. This patch series aims to re-implement the lockless slab

[dm-devel] [PATCH 13/29] ext4: dynamically allocate the ext4-es shrinker

2023-06-22 Thread Qi Zheng
In preparation for implementing lockless slab shrink, we need to dynamically allocate the ext4-es shrinker, so that it can be freed asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU read-side critical section when releasing the struct ext4_sb_info. Signed-off-by: Qi Zheng

Re: [dm-devel] [PATCH 00/29] use refcount+RCU method to implement lockless slab shrink

2023-06-22 Thread Qi Zheng
Hi all, Well, this one was sent successfully. Since I always get the following error message, I deleted the original cc people and only kept the mailing lists. 4.7.1 Error: too many recipients from 49.7.199.173 Thanks, Qi -- dm-devel mailing list dm-devel@redhat.com

[dm-devel] [PATCH 00/29] use refcount+RCU method to implement lockless slab shrink

2023-06-22 Thread Qi Zheng
Hi all, 1. Background = We used to implement the lockless slab shrink with SRCU [1], but then kernel test robot reported -88.8% regression in stress-ng.ramfs.ops_per_sec test case [2], so we reverted it [3]. This patch series aims to re-implement the lockless slab shrink using the

[dm-devel] [PATCH 12/29] mbcache: dynamically allocate the mbcache shrinker

2023-06-22 Thread Qi Zheng
From: Qi Zheng In preparation for implementing lockless slab shrink, we need to dynamically allocate the mbcache shrinker, so that it can be freed asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU read-side critical section when releasing the struct mb_cache. Signed-off-by:

[dm-devel] [PATCH 13/29] ext4: dynamically allocate the ext4-es shrinker

2023-06-22 Thread Qi Zheng
From: Qi Zheng In preparation for implementing lockless slab shrink, we need to dynamically allocate the ext4-es shrinker, so that it can be freed asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU read-side critical section when releasing the struct ext4_sb_info.

Re: [dm-devel] [External] [PATCH 00/29] use refcount+RCU method to implement lockless slab shrink

2023-06-22 Thread Qi Zheng
This patch set failed to send due to the following reasons, please ignore. 4.7.1 Error: too many recipients from 49.7.199.65 -- dm-devel mailing list dm-devel@redhat.com https://listman.redhat.com/mailman/listinfo/dm-devel

[dm-devel] [device-mapper-dm:for-next 19/24] drivers/md/dm-ioctl.c:1402:15: warning: format specifies type 'unsigned long' but the argument has type 'unsigned int'

2023-06-22 Thread kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm.git for-next head: 7d8bae011ec676d6c0a6ea18f2b74c9c32d57849 commit: 5df1daff2cc63af7971c0643134f3372aa3b33a1 [19/24] dm ioctl: Check dm_target_spec is sufficiently aligned config: hexagon-randconfig-r041-20230622

Re: [dm-devel] [PATCH v2 1/6] device-mapper: Check that target specs are sufficiently aligned

2023-06-22 Thread Mike Snitzer
On Thu, Jun 22 2023 at 3:51P -0400, Demi Marie Obenour wrote: > On Thu, Jun 22, 2023 at 12:28:28PM -0400, Mike Snitzer wrote: > > On Sat, Jun 03 2023 at 10:52P -0400, > > Demi Marie Obenour wrote: > > > > > Otherwise subsequent code will dereference a misaligned > > > `struct dm_target_spec

Re: [dm-devel] [PATCH v2 2/6] device-mapper: Avoid pointer arithmetic overflow

2023-06-22 Thread Mike Snitzer
On Sat, Jun 03 2023 at 10:52P -0400, Demi Marie Obenour wrote: > Especially on 32-bit systems, it is possible for the pointer arithmetic > to overflow and cause a userspace pointer to be dereferenced in the > kernel. > > Signed-off-by: Demi Marie Obenour > Fixes: 1da177e4c3f4

Re: [dm-devel] [PATCH v2 1/6] device-mapper: Check that target specs are sufficiently aligned

2023-06-22 Thread Demi Marie Obenour
On Thu, Jun 22, 2023 at 07:29:52PM +0200, Mikulas Patocka wrote: > > > On Sat, 3 Jun 2023, Demi Marie Obenour wrote: > > > Otherwise subsequent code will dereference a misaligned > > `struct dm_target_spec *`, which is undefined behavior. > > > > Signed-off-by: Demi Marie Obenour > > Fixes:

Re: [dm-devel] [PATCH v2 1/6] device-mapper: Check that target specs are sufficiently aligned

2023-06-22 Thread Demi Marie Obenour
On Thu, Jun 22, 2023 at 12:28:28PM -0400, Mike Snitzer wrote: > On Sat, Jun 03 2023 at 10:52P -0400, > Demi Marie Obenour wrote: > > > Otherwise subsequent code will dereference a misaligned > > `struct dm_target_spec *`, which is undefined behavior. > > > > Signed-off-by: Demi Marie Obenour >

Re: [dm-devel] [PATCH v2 4/6] device-mapper: Avoid double-fetch of version

2023-06-22 Thread Demi Marie Obenour
On Thu, Jun 22, 2023 at 12:20:40PM -0400, Mike Snitzer wrote: > On Sat, Jun 03 2023 at 10:52P -0400, > Demi Marie Obenour wrote: > > > The version is fetched once in check_version(), which then does some > > validation and then overwrites the version in userspace with the API > > version

Re: [dm-devel] [PATCH v2 1/6] device-mapper: Check that target specs are sufficiently aligned

2023-06-22 Thread Mike Snitzer
On Sat, Jun 03 2023 at 10:52P -0400, Demi Marie Obenour wrote: > Otherwise subsequent code will dereference a misaligned > `struct dm_target_spec *`, which is undefined behavior. > > Signed-off-by: Demi Marie Obenour > Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") > Cc: sta...@vger.kernel.org > ---

Re: [dm-devel] [PATCH v2 3/6] device-mapper: structs and parameter strings must not overlap

2023-06-22 Thread Mikulas Patocka
On Sat, 3 Jun 2023, Demi Marie Obenour wrote: > The NUL terminator for each target parameter string must precede the > following 'struct dm_target_spec'. Otherwise, dm_split_args() might > corrupt this struct. Furthermore, the first 'struct dm_target_spec' > must come after the 'struct

Re: [dm-devel] [PATCH v2 2/6] device-mapper: Avoid pointer arithmetic overflow

2023-06-22 Thread Mikulas Patocka
On Sat, 3 Jun 2023, Demi Marie Obenour wrote: > Especially on 32-bit systems, it is possible for the pointer arithmetic > to overflow and cause a userspace pointer to be dereferenced in the > kernel. > > Signed-off-by: Demi Marie Obenour > Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") > Cc:

Re: [dm-devel] [PATCH v2 1/6] device-mapper: Check that target specs are sufficiently aligned

2023-06-22 Thread Mikulas Patocka
On Sat, 3 Jun 2023, Demi Marie Obenour wrote: > Otherwise subsequent code will dereference a misaligned > `struct dm_target_spec *`, which is undefined behavior. > > Signed-off-by: Demi Marie Obenour > Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") > Cc: sta...@vger.kernel.org > --- >

Re: [dm-devel] [PATCH v2 4/6] device-mapper: Avoid double-fetch of version

2023-06-22 Thread Mike Snitzer
On Sat, Jun 03 2023 at 10:52P -0400, Demi Marie Obenour wrote: > The version is fetched once in check_version(), which then does some > validation and then overwrites the version in userspace with the API > version supported by the kernel. copy_params() then fetches the version > from userspace

Re: [dm-devel] [PATCH 14/24] init: clear root_wait on all invalid root= strings

2023-06-22 Thread Guenter Roeck
On 6/22/23 07:40, Christoph Hellwig wrote: On Thu, Jun 22, 2023 at 06:54:41AM -0700, Guenter Roeck wrote: On 6/21/23 23:00, Christoph Hellwig wrote: Hi Guenter, can you try this patch? diff --git a/block/early-lookup.c b/block/early-lookup.c index a5be3c68ed079c..66e4514d671179 100644 ---

Re: [dm-devel] [PATCH 14/24] init: clear root_wait on all invalid root= strings

2023-06-22 Thread Christoph Hellwig
On Thu, Jun 22, 2023 at 06:54:41AM -0700, Guenter Roeck wrote: > On 6/21/23 23:00, Christoph Hellwig wrote: >> Hi Guenter, >> >> can you try this patch? >> >> diff --git a/block/early-lookup.c b/block/early-lookup.c >> index a5be3c68ed079c..66e4514d671179 100644 >> --- a/block/early-lookup.c >>

Re: [dm-devel] [PATCH 14/24] init: clear root_wait on all invalid root= strings

2023-06-22 Thread Guenter Roeck
On 6/21/23 23:00, Christoph Hellwig wrote: Hi Guenter, can you try this patch? diff --git a/block/early-lookup.c b/block/early-lookup.c index a5be3c68ed079c..66e4514d671179 100644 --- a/block/early-lookup.c +++ b/block/early-lookup.c @@ -174,7 +174,7 @@ static int __init

Re: [dm-devel] [PATCH v2 13/16] xen-blkback: Implement diskseq checks

2023-06-22 Thread Roger Pau Monné
On Tue, Jun 20, 2023 at 09:14:25PM -0400, Demi Marie Obenour wrote: > On Mon, Jun 12, 2023 at 10:09:39AM +0200, Roger Pau Monné wrote: > > On Fri, Jun 09, 2023 at 12:55:39PM -0400, Demi Marie Obenour wrote: > > > On Fri, Jun 09, 2023 at 05:13:45PM +0200, Roger Pau Monné wrote: > > > > On Thu, Jun

Re: [dm-devel] [PATCH 14/24] init: clear root_wait on all invalid root= strings

2023-06-22 Thread Christoph Hellwig
Hi Guenter, can you try this patch? diff --git a/block/early-lookup.c b/block/early-lookup.c index a5be3c68ed079c..66e4514d671179 100644 --- a/block/early-lookup.c +++ b/block/early-lookup.c @@ -174,7 +174,7 @@ static int __init devt_from_devname(const char *name, dev_t *devt) while (p