Re: [PATCH 08/13] lib min_heap: Add args for min_heap_callbacks

2024-03-19 Thread Ian Rogers
On Tue, Mar 19, 2024 at 7:49 PM Kuan-Wei Chiu wrote: > > On Tue, Mar 19, 2024 at 01:05:18PM -0700, Ian Rogers wrote: > > On Tue, Mar 19, 2024 at 11:00 AM Kuan-Wei Chiu wrote: > > > > > > Add a third parameter 'args' for the 'less' and 'swp' functions in the > > > 'struct min_heap_callbacks'.

Re: [RFC Patch] dm: make sure to wait for all dispatched requests in __dm_suspend()

2024-03-19 Thread Ming Lei
On Tue, Mar 19, 2024 at 04:41:26PM +0100, Martin Wilck wrote: > Hello Ming, > > On Tue, 2024-03-19 at 21:04 +0800, Ming Lei wrote: > > Hello Martin, > > > > On Sat, Mar 16, 2024 at 12:10:35AM +0100, Martin Wilck wrote: > > > In a recent kernel dump analysis, we found that the kernel crashed > >

Re: [PATCH 00/13] treewide: Refactor heap related implementation

2024-03-19 Thread Kuan-Wei Chiu
On Tue, Mar 19, 2024 at 06:12:17PM -0400, Kent Overstreet wrote: > On Wed, Mar 20, 2024 at 01:59:52AM +0800, Kuan-Wei Chiu wrote: > > Hello, > > > > This patch series focuses on several adjustments related to heap > > implementation. Firstly, a type-safe interface has been added to the > >

Re: [PATCH 05/13] lib min_heap: Add min_heap_init()

2024-03-19 Thread Kuan-Wei Chiu
On Tue, Mar 19, 2024 at 12:51:22PM -0700, Ian Rogers wrote: > On Tue, Mar 19, 2024 at 11:00 AM Kuan-Wei Chiu wrote: > > > > Add min_heap_init() for initializing heap with data, nr, and size. > > > > Signed-off-by: Kuan-Wei Chiu > > Should this change update lib/test_min_heap.c to use

Re: [PATCH 13/13] bcachefs: Remove heap-related macros and switch to generic min_heap

2024-03-19 Thread Kuan-Wei Chiu
On Tue, Mar 19, 2024 at 01:03:17PM -0700, Ian Rogers wrote: > On Tue, Mar 19, 2024 at 11:01 AM Kuan-Wei Chiu wrote: > > > > Drop the heap-related macros from bcachefs and replaces them with the > > generic min_heap implementation from include/linux. This change > > improves code readability by

Re: [PATCH 12/13] lib min_heap: Add min_heap_sift_up()

2024-03-19 Thread Kuan-Wei Chiu
On Tue, Mar 19, 2024 at 01:12:18PM -0700, Ian Rogers wrote: > On Tue, Mar 19, 2024 at 11:01 AM Kuan-Wei Chiu wrote: > > > > Add min_heap_sift_up() to sift up the element at index 'idx' in the > > heap. > > Normally sift up is used to implement the min heap but isn't part of > the API, eg. there

Re: [PATCH 08/13] lib min_heap: Add args for min_heap_callbacks

2024-03-19 Thread Kuan-Wei Chiu
On Tue, Mar 19, 2024 at 01:05:18PM -0700, Ian Rogers wrote: > On Tue, Mar 19, 2024 at 11:00 AM Kuan-Wei Chiu wrote: > > > > Add a third parameter 'args' for the 'less' and 'swp' functions in the > > 'struct min_heap_callbacks'. This additional parameter allows these > > comparison and swap

Re: [PATCH 00/13] treewide: Refactor heap related implementation

2024-03-19 Thread Kent Overstreet
On Wed, Mar 20, 2024 at 01:59:52AM +0800, Kuan-Wei Chiu wrote: > Hello, > > This patch series focuses on several adjustments related to heap > implementation. Firstly, a type-safe interface has been added to the > min_heap, along with the introduction of several new functions to > enhance its

Re: [RFC Patch] dm: make sure to wait for all dispatched requests in __dm_suspend()

2024-03-19 Thread Martin Wilck
Mike, On Tue, 2024-03-19 at 12:53 -0400, Mike Snitzer wrote: > > While I appreciate you making us aware of this crash, I'm really not > interested in going down the rabbit hole of reasoning through fairly > complex concerns unless you have gotten your customer a kernel with > latest fixes (e.g.

+ maintainers-remove-incorrect-m-tag-for-dm-devel-listslinuxdev.patch added to mm-hotfixes-unstable branch

2024-03-19 Thread Andrew Morton
The patch titled Subject: MAINTAINERS: remove incorrect M: tag for dm-devel@lists.linux.dev has been added to the -mm mm-hotfixes-unstable branch. Its filename is maintainers-remove-incorrect-m-tag-for-dm-devel-listslinuxdev.patch This patch will shortly appear at

Re: [PATCH 03/13] bcachefs: Fix typo

2024-03-19 Thread Ian Rogers
On Tue, Mar 19, 2024 at 11:00 AM Kuan-Wei Chiu wrote: > > Replace 'utiility' with 'utility'. > > Signed-off-by: Kuan-Wei Chiu Reviewed-by: Ian Rogers Thanks, Ian > --- > fs/bcachefs/util.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/fs/bcachefs/util.c

Re: [PATCH 02/13] bcache: Fix typo

2024-03-19 Thread Ian Rogers
On Tue, Mar 19, 2024 at 11:00 AM Kuan-Wei Chiu wrote: > > Replace 'utiility' with 'utility'. > > Signed-off-by: Kuan-Wei Chiu Reviewed-by: Ian Rogers Thanks, Ian > --- > drivers/md/bcache/util.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git

Re: [PATCH 12/13] lib min_heap: Add min_heap_sift_up()

2024-03-19 Thread Ian Rogers
On Tue, Mar 19, 2024 at 11:01 AM Kuan-Wei Chiu wrote: > > Add min_heap_sift_up() to sift up the element at index 'idx' in the > heap. Normally sift up is used to implement the min heap but isn't part of the API, eg. there is a sift up in min_heap_push. Should min_heapify be renamed to

Re: [PATCH 08/13] lib min_heap: Add args for min_heap_callbacks

2024-03-19 Thread Ian Rogers
On Tue, Mar 19, 2024 at 11:00 AM Kuan-Wei Chiu wrote: > > Add a third parameter 'args' for the 'less' and 'swp' functions in the > 'struct min_heap_callbacks'. This additional parameter allows these > comparison and swap functions to handle extra arguments when necessary. > > Signed-off-by:

Re: [PATCH 13/13] bcachefs: Remove heap-related macros and switch to generic min_heap

2024-03-19 Thread Ian Rogers
On Tue, Mar 19, 2024 at 11:01 AM Kuan-Wei Chiu wrote: > > Drop the heap-related macros from bcachefs and replaces them with the > generic min_heap implementation from include/linux. This change > improves code readability by using functions instead of macros. > > Link: >

Re: [PATCH 11/13] lib min_heap: Add min_heap_del()

2024-03-19 Thread Ian Rogers
On Tue, Mar 19, 2024 at 11:01 AM Kuan-Wei Chiu wrote: > > Add min_heap_del() to delete the element at index 'idx' in the heap. > > Signed-off-by: Kuan-Wei Chiu Reviewed-by: Ian Rogers Thanks, Ian > --- > include/linux/min_heap.h | 24 > 1 file changed, 24

Re: [PATCH 09/13] lib min_heap: Update min_heap_push() and min_heap_pop() to return bool values

2024-03-19 Thread Ian Rogers
On Tue, Mar 19, 2024 at 11:00 AM Kuan-Wei Chiu wrote: > > Modify the min_heap_push() and min_heap_pop() to return a boolean > value. They now return false when the operation fails and true when it > succeeds. > > Signed-off-by: Kuan-Wei Chiu Nice change. Reviewed-by: Ian Rogers Thanks, Ian

Re: [PATCH 07/13] lib min_heap: Add min_heap_full()

2024-03-19 Thread Ian Rogers
On Tue, Mar 19, 2024 at 11:00 AM Kuan-Wei Chiu wrote: > > Add min_heap_full() which returns a boolean value indicating whether > the heap has reached its maximum capacity. > > Signed-off-by: Kuan-Wei Chiu I see there's coverage of these functions caused by later changes. Reviewed-by: Ian

Re: [PATCH 06/13] lib min_heap: Add min_heap_peek()

2024-03-19 Thread Ian Rogers
On Tue, Mar 19, 2024 at 11:00 AM Kuan-Wei Chiu wrote: > > Add min_heap_peek() function to retrieve a pointer to the smallest > element. The pointer is cast to the appropriate type of heap elements. > > Signed-off-by: Kuan-Wei Chiu I see there's coverage of these functions caused by later

Re: [PATCH 05/13] lib min_heap: Add min_heap_init()

2024-03-19 Thread Ian Rogers
On Tue, Mar 19, 2024 at 11:00 AM Kuan-Wei Chiu wrote: > > Add min_heap_init() for initializing heap with data, nr, and size. > > Signed-off-by: Kuan-Wei Chiu Should this change update lib/test_min_heap.c to use min_heap_init? Thanks, Ian > --- > include/linux/min_heap.h | 12 >

Re: [PATCH 04/13] lib min_heap: Add type safe interface

2024-03-19 Thread Ian Rogers
On Tue, Mar 19, 2024 at 11:00 AM Kuan-Wei Chiu wrote: > > Introduce a type-safe interface for min_heap by adding small macro > wrappers around functions and using a 0-size array to store type > information. This enables the use of __minheap_cast and > __minheap_obj_size macros for type casting

Re: [PATCH 01/13] perf/core: Fix several typos

2024-03-19 Thread Ian Rogers
On Tue, Mar 19, 2024 at 11:00 AM Kuan-Wei Chiu wrote: > > Replace 'artifically' with 'artificially'. > Replace 'irrespecive' with 'irrespective'. > Replace 'futher' with 'further'. > Replace 'sufficent' with 'sufficient'. > > Signed-off-by: Kuan-Wei Chiu Reviewed-by: Ian Rogers Thanks, Ian >

[PATCH] MAINTAINERS: Remove incorrect M: tag for dm-devel@lists.linux.dev

2024-03-19 Thread Kuan-Wei Chiu
The dm-devel@lists.linux.dev mailing list should only be listed under the L: (List) tag in the MAINTAINERS file. However, it was incorrectly listed under both L: and M: (Maintainers) tags, which is not accurate. Remove the M: tag for dm-devel@lists.linux.dev in the MAINTAINERS file to reflect the

[PATCH 13/13] bcachefs: Remove heap-related macros and switch to generic min_heap

2024-03-19 Thread Kuan-Wei Chiu
Drop the heap-related macros from bcachefs and replaces them with the generic min_heap implementation from include/linux. This change improves code readability by using functions instead of macros. Link: https://lkml.kernel.org/ioyfizrzq7w7mjrqcadtzsfgpuntowtjdw5pgn4qhvsdp4mqqg@nrlek5vmisbu

[PATCH 12/13] lib min_heap: Add min_heap_sift_up()

2024-03-19 Thread Kuan-Wei Chiu
Add min_heap_sift_up() to sift up the element at index 'idx' in the heap. Signed-off-by: Kuan-Wei Chiu --- include/linux/min_heap.h | 20 1 file changed, 20 insertions(+) diff --git a/include/linux/min_heap.h b/include/linux/min_heap.h index ce085137fce7..586965977104

[PATCH 11/13] lib min_heap: Add min_heap_del()

2024-03-19 Thread Kuan-Wei Chiu
Add min_heap_del() to delete the element at index 'idx' in the heap. Signed-off-by: Kuan-Wei Chiu --- include/linux/min_heap.h | 24 1 file changed, 24 insertions(+) diff --git a/include/linux/min_heap.h b/include/linux/min_heap.h index 154ac2102114..ce085137fce7

[PATCH 10/13] bcache: Remove heap-related macros and switch to generic min_heap

2024-03-19 Thread Kuan-Wei Chiu
Drop the heap-related macros from bcache and replaces them with the generic min_heap implementation from include/linux. This change improves code readability by using functions instead of macros. Link: https://lkml.kernel.org/ioyfizrzq7w7mjrqcadtzsfgpuntowtjdw5pgn4qhvsdp4mqqg@nrlek5vmisbu

[PATCH 09/13] lib min_heap: Update min_heap_push() and min_heap_pop() to return bool values

2024-03-19 Thread Kuan-Wei Chiu
Modify the min_heap_push() and min_heap_pop() to return a boolean value. They now return false when the operation fails and true when it succeeds. Signed-off-by: Kuan-Wei Chiu --- include/linux/min_heap.h | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git

[PATCH 08/13] lib min_heap: Add args for min_heap_callbacks

2024-03-19 Thread Kuan-Wei Chiu
Add a third parameter 'args' for the 'less' and 'swp' functions in the 'struct min_heap_callbacks'. This additional parameter allows these comparison and swap functions to handle extra arguments when necessary. Signed-off-by: Kuan-Wei Chiu --- drivers/md/dm-vdo/repair.c | 10 +++

[PATCH 07/13] lib min_heap: Add min_heap_full()

2024-03-19 Thread Kuan-Wei Chiu
Add min_heap_full() which returns a boolean value indicating whether the heap has reached its maximum capacity. Signed-off-by: Kuan-Wei Chiu --- include/linux/min_heap.h | 10 ++ 1 file changed, 10 insertions(+) diff --git a/include/linux/min_heap.h b/include/linux/min_heap.h index

[PATCH 06/13] lib min_heap: Add min_heap_peek()

2024-03-19 Thread Kuan-Wei Chiu
Add min_heap_peek() function to retrieve a pointer to the smallest element. The pointer is cast to the appropriate type of heap elements. Signed-off-by: Kuan-Wei Chiu --- include/linux/min_heap.h | 10 ++ 1 file changed, 10 insertions(+) diff --git a/include/linux/min_heap.h

[PATCH 05/13] lib min_heap: Add min_heap_init()

2024-03-19 Thread Kuan-Wei Chiu
Add min_heap_init() for initializing heap with data, nr, and size. Signed-off-by: Kuan-Wei Chiu --- include/linux/min_heap.h | 12 1 file changed, 12 insertions(+) diff --git a/include/linux/min_heap.h b/include/linux/min_heap.h index c3635a7fdb88..ed462f194b88 100644 ---

[PATCH 04/13] lib min_heap: Add type safe interface

2024-03-19 Thread Kuan-Wei Chiu
Introduce a type-safe interface for min_heap by adding small macro wrappers around functions and using a 0-size array to store type information. This enables the use of __minheap_cast and __minheap_obj_size macros for type casting and obtaining element size. The implementation draws inspiration

[PATCH 03/13] bcachefs: Fix typo

2024-03-19 Thread Kuan-Wei Chiu
Replace 'utiility' with 'utility'. Signed-off-by: Kuan-Wei Chiu --- fs/bcachefs/util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/bcachefs/util.c b/fs/bcachefs/util.c index 216fadf16928..f5a16ad65424 100644 --- a/fs/bcachefs/util.c +++ b/fs/bcachefs/util.c @@ -1,6

[PATCH 02/13] bcache: Fix typo

2024-03-19 Thread Kuan-Wei Chiu
Replace 'utiility' with 'utility'. Signed-off-by: Kuan-Wei Chiu --- drivers/md/bcache/util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/md/bcache/util.c b/drivers/md/bcache/util.c index ae380bc3992e..410d8cb49e50 100644 --- a/drivers/md/bcache/util.c +++

[PATCH 01/13] perf/core: Fix several typos

2024-03-19 Thread Kuan-Wei Chiu
Replace 'artifically' with 'artificially'. Replace 'irrespecive' with 'irrespective'. Replace 'futher' with 'further'. Replace 'sufficent' with 'sufficient'. Signed-off-by: Kuan-Wei Chiu --- kernel/events/core.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git

[PATCH 00/13] treewide: Refactor heap related implementation

2024-03-19 Thread Kuan-Wei Chiu
Hello, This patch series focuses on several adjustments related to heap implementation. Firstly, a type-safe interface has been added to the min_heap, along with the introduction of several new functions to enhance its functionality. Additionally, the heap implementation for bcache and bcachefs

Re: [RFC Patch] dm: make sure to wait for all dispatched requests in __dm_suspend()

2024-03-19 Thread Mike Snitzer
On Tue, Mar 19 2024 at 11:41P -0400, Martin Wilck wrote: > Hello Ming, > > On Tue, 2024-03-19 at 21:04 +0800, Ming Lei wrote: > > Hello Martin, > > > > On Sat, Mar 16, 2024 at 12:10:35AM +0100, Martin Wilck wrote: > > > In a recent kernel dump analysis, we found that the kernel crashed > > >

Re: [RFC Patch] dm: make sure to wait for all dispatched requests in __dm_suspend()

2024-03-19 Thread Martin Wilck
Hello Ming, On Tue, 2024-03-19 at 21:04 +0800, Ming Lei wrote: > Hello Martin, > > On Sat, Mar 16, 2024 at 12:10:35AM +0100, Martin Wilck wrote: > > In a recent kernel dump analysis, we found that the kernel crashed > > because > > dm_rq_target_io tio->ti was pointing to invalid memory in > >

Re: [RFC Patch] dm: make sure to wait for all dispatched requests in __dm_suspend()

2024-03-19 Thread Ming Lei
Hello Martin, On Sat, Mar 16, 2024 at 12:10:35AM +0100, Martin Wilck wrote: > In a recent kernel dump analysis, we found that the kernel crashed because > dm_rq_target_io tio->ti was pointing to invalid memory in dm_end_request(), > in a situation where multipathd was doing map reloads because of