Re: [PATCH v3] virtio_pmem: support feature SHMEM_REGION

2023-12-19 Thread Michael S. Tsirkin
On Tue, Dec 19, 2023 at 11:32:27PM -0800, Changyuan Lyu wrote: > On Tue, Dec 19, 2023 at 11:01 PM Michael S. Tsirkin wrote: > > > > This is not a great description. Please describe what the patch does. > > Thanks for the feedback! Please see the v3 patch below. > > ---8<--- > > This patch

[PATCH v3] virtio_pmem: support feature SHMEM_REGION

2023-12-19 Thread Changyuan Lyu
On Tue, Dec 19, 2023 at 11:01 PM Michael S. Tsirkin wrote: > > This is not a great description. Please describe what the patch does. Thanks for the feedback! Please see the v3 patch below. ---8<--- This patch adds the support for feature VIRTIO_PMEM_F_SHMEM_REGION (virtio spec v1.2 section

Re: [PATCH v2] virtio_pmem: support feature SHMEM_REGION

2023-12-19 Thread Michael S. Tsirkin
On Tue, Dec 19, 2023 at 10:13:00PM -0800, Changyuan Lyu wrote: > On Tue, Dec 19, 2023 at 7:57 PM Jason Wang wrote: > > > > On Tue, Dec 19, 2023 at 3:19 PM Changyuan Lyu wrote: > > > > > > +/* shmid of the shared memory region corresponding to the pmem */ > > > +#define VIRTIO_PMEM_SHMCAP_ID 0 >

[PATCH v2] virtio_pmem: support feature SHMEM_REGION

2023-12-19 Thread Changyuan Lyu
On Tue, Dec 19, 2023 at 7:57 PM Jason Wang wrote: > > On Tue, Dec 19, 2023 at 3:19 PM Changyuan Lyu wrote: > > > > +/* shmid of the shared memory region corresponding to the pmem */ > > +#define VIRTIO_PMEM_SHMCAP_ID 0 > > NIT: not a native speaker, but any reason for "CAP" here? Would it be >

[PATCH] tracing/synthetic: fix kernel-doc warnings

2023-12-19 Thread Randy Dunlap
scripts/kernel-doc warns about using @args: for variadic arguments to functions. Documentation/doc-guide/kernel-doc.rst says that this should be written as @...: instead, so update the source code to match that, preventing the warnings. trace_events_synth.c:1165: warning: Excess function

[PATCH V4] remoteproc: qcom: q6v5: Get crash reason from specific SMEM partition

2023-12-19 Thread Vignesh Viswanathan
q6v5 fatal and watchdog IRQ handlers always retrieves the crash reason information from SMEM global partition (QCOM_SMEM_HOST_ANY). For some targets like IPQ9574 and IPQ5332, crash reason information is present in target specific partition due to which the crash reason is not printed in the

Re: [PATCH] modules: wait do_free_init correctly

2023-12-19 Thread Changbin Du
On Tue, Dec 19, 2023 at 01:52:03PM -0800, Luis Chamberlain wrote: > On Tue, Dec 19, 2023 at 12:51:51PM -0800, Andrew Morton wrote: > > On Tue, 19 Dec 2023 22:12:31 +0800 Changbin Du > > wrote: > > > > > The commit 1a7b7d922081 ("modules: Use vmalloc special flag") moves > > > do_free_init()

Re: [PATCH RFC 0/4] virtio-net: add tx-hash, rx-tstamp, tx-tstamp and tx-time

2023-12-19 Thread Willem de Bruijn
Jason Wang wrote: > On Tue, Dec 19, 2023 at 12:36 AM Willem de Bruijn > wrote: > > > > Steffen Trumtrar wrote: > > > This series tries to pick up the work on the virtio-net timestamping > > > feature from Willem de Bruijn. > > > > > > Original series > > > Message-Id:

Re: [PATCH vhost v4 02/15] vdpa: Add VHOST_BACKEND_F_CHANGEABLE_VQ_ADDR_IN_SUSPEND flag

2023-12-19 Thread Jason Wang
On Wed, Dec 20, 2023 at 11:46 AM Jason Wang wrote: > > On Wed, Dec 20, 2023 at 2:09 AM Dragos Tatulea wrote: > > > > The virtio spec doesn't allow changing virtqueue addresses after > > DRIVER_OK. Some devices do support this operation when the device is > > suspended. The

Re: [PATCH] vdpa: Fix an error handling path in eni_vdpa_probe()

2023-12-19 Thread Jason Wang
On Fri, Dec 8, 2023 at 5:14 AM Christophe JAILLET wrote: > > Le 20/10/2022 à 21:21, Christophe JAILLET a écrit : > > After a successful vp_legacy_probe() call, vp_legacy_remove() should be > > called in the error handling path, as already done in the remove function. > > > > Add the missing call.

Re: [PATCH] virtio_pmem: support feature SHMEM_REGION

2023-12-19 Thread Jason Wang
On Tue, Dec 19, 2023 at 3:19 PM Changyuan Lyu wrote: > > As per virtio spec 1.2 section 5.19.5.2, if the feature > VIRTIO_PMEM_F_SHMEM_REGION has been negotiated, the driver MUST query > shared memory ID 0 for the physical address ranges. > > Signed-off-by: Changyuan Lyu > --- >

Re: [PATCH] vdpa: Remove usage of the deprecated ida_simple_xx() API

2023-12-19 Thread Jason Wang
On Mon, Dec 11, 2023 at 1:52 AM Christophe JAILLET wrote: > > ida_alloc() and ida_free() should be preferred to the deprecated > ida_simple_get() and ida_simple_remove(). > > This is less verbose. > > Signed-off-by: Christophe JAILLET Acked-by: Jason Wang Thanks > --- > drivers/vdpa/vdpa.c

Re: [PATCH v5 2/4] vduse: Temporarily disable control queue features

2023-12-19 Thread Jason Wang
On Mon, Dec 18, 2023 at 5:21 PM Maxime Coquelin wrote: > > > > On 12/18/23 03:50, Jason Wang wrote: > > On Wed, Dec 13, 2023 at 7:23 PM Maxime Coquelin > > wrote: > >> > >> Hi Jason, > >> > >> On 12/13/23 05:52, Jason Wang wrote: > >>> On Tue, Dec 12, 2023 at 9:17 PM Maxime Coquelin > >>>

Re: [PATCH RFC 0/4] virtio-net: add tx-hash, rx-tstamp, tx-tstamp and tx-time

2023-12-19 Thread Jason Wang
On Tue, Dec 19, 2023 at 12:36 AM Willem de Bruijn wrote: > > Steffen Trumtrar wrote: > > This series tries to pick up the work on the virtio-net timestamping > > feature from Willem de Bruijn. > > > > Original series > > Message-Id: 20210208185558.995292-1-willemdebruijn.ker...@gmail.com > >

Re: [PATCH vhost v4 14/15] vdpa/mlx5: Introduce reference counting to mrs

2023-12-19 Thread Jason Wang
On Wed, Dec 20, 2023 at 2:10 AM Dragos Tatulea wrote: > > Deleting the old mr during mr update (.set_map) and then modifying the > vqs with the new mr is not a good flow for firmware. The firmware > expects that mkeys are deleted after there are no more vqs referencing > them. > > Introduce

Re: [PATCH vhost v4 13/15] vdpa/mlx5: Use vq suspend/resume during .set_map

2023-12-19 Thread Jason Wang
On Wed, Dec 20, 2023 at 2:10 AM Dragos Tatulea wrote: > > Instead of tearing down and setting up vq resources, use vq > suspend/resume during .set_map to speed things up a bit. > > The vq mr is updated with the new mapping while the vqs are suspended. > > If the device doesn't support resumable

Re: [PATCH vhost v4 12/15] vdpa/mlx5: Mark vq state for modification in hw vq

2023-12-19 Thread Jason Wang
On Wed, Dec 20, 2023 at 2:10 AM Dragos Tatulea wrote: > > .set_vq_state will set the indices and mark the fields to be modified in > the hw vq. > > Advertise that the device supports changing the vq state when the device > is in DRIVER_OK state and suspended. > > Reviewed-by: Gal Pressman >

Re: [PATCH vhost v4 10/15] vdpa/mlx5: Introduce per vq and device resume

2023-12-19 Thread Jason Wang
On Wed, Dec 20, 2023 at 2:10 AM Dragos Tatulea wrote: > > Implement vdpa vq and device resume if capability detected. Add support > for suspend -> ready state change. > > Reviewed-by: Gal Pressman > Acked-by: Eugenio Pérez > Signed-off-by: Dragos Tatulea Acked-by: Jason Wang Thanks

Re: [PATCH vhost v4 09/15] vdpa/mlx5: Allow modifying multiple vq fields in one modify command

2023-12-19 Thread Jason Wang
On Wed, Dec 20, 2023 at 2:10 AM Dragos Tatulea wrote: > > Add a bitmask variable that tracks hw vq field changes that > are supposed to be modified on next hw vq change command. > > This will be useful to set multiple vq fields when resuming the vq. > > Reviewed-by: Gal Pressman > Acked-by:

Re: [PATCH vhost v4 06/15] vdpa: Track device suspended state

2023-12-19 Thread Jason Wang
On Wed, Dec 20, 2023 at 2:09 AM Dragos Tatulea wrote: > > Set vdpa device suspended state on successful suspend. Clear it on > successful resume and reset. > > The state will be locked by the vhost_vdpa mutex. The mutex is taken > during suspend, resume and reset in vhost_vdpa_unlocked_ioctl. The

Re: [PATCH vhost v4 02/15] vdpa: Add VHOST_BACKEND_F_CHANGEABLE_VQ_ADDR_IN_SUSPEND flag

2023-12-19 Thread Jason Wang
On Wed, Dec 20, 2023 at 2:09 AM Dragos Tatulea wrote: > > The virtio spec doesn't allow changing virtqueue addresses after > DRIVER_OK. Some devices do support this operation when the device is > suspended. The VHOST_BACKEND_F_CHANGEABLE_VQ_ADDR_IN_SUSPEND flag > advertises this support as a

Re: [PATCH mlx5-vhost v4 01/15] vdpa/mlx5: Expose resumable vq capability

2023-12-19 Thread Jason Wang
On Wed, Dec 20, 2023 at 2:09 AM Dragos Tatulea wrote: > > Necessary for checking if resumable vqs are supported by the hardware. > Actual support will be added in a downstream patch. > > Reviewed-by: Gal Pressman > Acked-by: Eugenio Pérez > Signed-off-by: Dragos Tatulea Acked-by: Jason Wang

[PATCH -next v4 2/2] mm: vmscan: add new event to trace shrink lru

2023-12-19 Thread Bixuan Cui
From: cuibixuan Add a new event to calculate the shrink_inactive_list()/shrink_active_list() execution time. Example of output: kswapd0-103 [007] . 1098.353020: mm_vmscan_lru_shrink_active_start: nid=0 kswapd0-103 [007] . 1098.353040:

[PATCH -next v4 1/2] mm: shrinker: add new event to trace shrink count

2023-12-19 Thread Bixuan Cui
From: cuibixuan do_shrink_slab() calculates the freeable memory through shrinker->count_objects(), and then reclaims the memory through shrinker->scan_objects(). When reclaiming memory, shrinker->count_objects() takes a certain amount of time: Fun spend(us)

[PATCH -next v4 0/2] Make memory reclamation measurable

2023-12-19 Thread Bixuan Cui
When the system memory is low, kswapd reclaims the memory. The key steps of memory reclamation include 1.shrink_lruvec * shrink_active_list, moves folios from the active LRU to the inactive LRU * shrink_inactive_list, shrink lru from inactive LRU list 2.shrink_slab *

Re: [PATCH v5 28/34] fprobe: Rewrite fprobe on function-graph tracer

2023-12-19 Thread Google
On Tue, 19 Dec 2023 15:39:03 +0100 Jiri Olsa wrote: > On Mon, Dec 18, 2023 at 10:17:10PM +0900, Masami Hiramatsu (Google) wrote: > > SNIP > > > -static void fprobe_exit_handler(struct rethook_node *rh, void *data, > > - unsigned long ret_ip, struct pt_regs *regs) > >

Re: [PATCH] ring-buffer: Fix slowpath of interrupted event

2023-12-19 Thread Google
On Tue, 19 Dec 2023 10:10:27 -0500 Steven Rostedt wrote: > On Tue, 19 Dec 2023 23:37:10 +0900 > Masami Hiramatsu (Google) wrote: > > > Yeah the above works, but my question is, do we really need this > > really slow path? I mean; > > > > > if (w == write - event length) { > > > /*

Re: [PATCH] [v2] nvdimm-btt: fix several memleaks

2023-12-19 Thread Ira Weiny
dinghao.liu@ wrote: > > Ira Weiny wrote: > > > Dinghao Liu wrote: > > > > [snip] > > > > -static int btt_freelist_init(struct arena_info *arena) > > +static int btt_freelist_init(struct device *dev, struct arena_info *arena) > > > > Both struct arena_info and struct btt contain references to

Re: [PATCH v5 24/34] fprobe: Use ftrace_regs in fprobe entry handler

2023-12-19 Thread Google
On Tue, 19 Dec 2023 14:23:48 +0100 Jiri Olsa wrote: > On Mon, Dec 18, 2023 at 10:16:23PM +0900, Masami Hiramatsu (Google) wrote: > > SNIP > > > diff --git a/kernel/trace/bpf_trace.c b/kernel/trace/bpf_trace.c > > index 84e8a0f6e4e0..d3f8745d8ead 100644 > > --- a/kernel/trace/bpf_trace.c > >

[PATCH v5 16/15] ring-buffer: Use subbuf_order for buffer page masking

2023-12-19 Thread Steven Rostedt
From: "Steven Rostedt (Google)" The comparisons to PAGE_SIZE were all converted to use the buffer->subbuf_order, but the use of PAGE_MASK was missed. Convert all the PAGE_MASK usages over to: (PAGE_SIZE << cpu_buffer->buffer->subbuf_order) - 1 Fixes: TBD ("ring-buffer: Page size per ring

Re: [PATCH] modules: wait do_free_init correctly

2023-12-19 Thread Luis Chamberlain
On Tue, Dec 19, 2023 at 12:51:51PM -0800, Andrew Morton wrote: > On Tue, 19 Dec 2023 22:12:31 +0800 Changbin Du wrote: > > > The commit 1a7b7d922081 ("modules: Use vmalloc special flag") moves > > do_free_init() into a global workqueue instead of call_rcu(). So now > > we should wait it via

Re: [PATCH 0/4] Section alignment issues?

2023-12-19 Thread Luis Chamberlain
On Wed, Nov 22, 2023 at 11:18:10PM +0100, del...@kernel.org wrote: > From: Helge Deller > My questions: > - Am I wrong with my analysis? This would typically of course depend on the arch, but whether it helps is what I would like to see with real numbers rather then speculation. Howeer, I don't

Re: [PATCH] modules: wait do_free_init correctly

2023-12-19 Thread Andrew Morton
On Tue, 19 Dec 2023 22:12:31 +0800 Changbin Du wrote: > The commit 1a7b7d922081 ("modules: Use vmalloc special flag") moves > do_free_init() into a global workqueue instead of call_rcu(). So now > we should wait it via flush_work(). What are the runtime effects of this change?

Re: [PATCH v8 0/2] Introducing trace buffer mapping by user-space

2023-12-19 Thread Steven Rostedt
On Tue, 19 Dec 2023 18:45:54 + Vincent Donnefort wrote: > The tracing ring-buffers can be stored on disk or sent to network > without any copy via splice. However the later doesn't allow real time > processing of the traces. A solution is to give userspace direct access > to the ring-buffer

[PATCH v5 15/15] tracing: Update subbuffer with kilobytes not page order

2023-12-19 Thread Steven Rostedt
From: "Steven Rostedt (Google)" Using page order for deciding what the size of the ring buffer sub buffers are is exposing a bit too much of the implementation. Although the sub buffers are only allocated in orders of pages, allow the user to specify the minimum size of each sub-buffer via

[PATCH v5 14/15] ringbuffer/selftest: Add basic selftest to test changing subbuf order

2023-12-19 Thread Steven Rostedt
From: "Steven Rostedt (Google)" Add a self test that will write into the trace buffer with differ trace sub buffer order sizes. Signed-off-by: Steven Rostedt (Google) --- .../ftrace/test.d/00basic/ringbuffer_order.tc | 95 +++ 1 file changed, 95 insertions(+) create mode

[PATCH v5 13/15] ring-buffer: Add documentation on the buffer_subbuf_order file

2023-12-19 Thread Steven Rostedt
From: "Steven Rostedt (Google)" Add to the documentation how to use the buffer_subbuf_order file to change the size and how it affects what events can be added to the ring buffer. Signed-off-by: Steven Rostedt (Google) --- Documentation/trace/ftrace.rst | 27 +++ 1

[PATCH v5 12/15] ring-buffer: Just update the subbuffers when changing their allocation order

2023-12-19 Thread Steven Rostedt
From: "Steven Rostedt (Google)" The ring_buffer_subbuf_order_set() was creating ring_buffer_per_cpu cpu_buffers with the new subbuffers with the updated order, and if they all successfully were created, then they the ring_buffer's per_cpu buffers would be freed and replaced by them. The problem

[PATCH v5 09/15] tracing: Update snapshot order along with main buffer order

2023-12-19 Thread Steven Rostedt
From: "Steven Rostedt (Google)" When updating the order of the sub buffers for the main buffer, make sure that if the snapshot buffer exists, that it gets its order updated as well. Signed-off-by: Steven Rostedt (Google) --- kernel/trace/trace.c | 45

[PATCH v5 11/15] ring-buffer: Keep the same size when updating the order

2023-12-19 Thread Steven Rostedt
From: "Steven Rostedt (Google)" The function ring_buffer_subbuf_order_set() just updated the sub-buffers to the new size, but this also changes the size of the buffer in doing so. As the size is determined by nr_pages * subbuf_size. If the subbuf_size is increased without decreasing the

[PATCH v5 10/15] tracing: Stop the tracing while changing the ring buffer subbuf size

2023-12-19 Thread Steven Rostedt
From: "Steven Rostedt (Google)" Because the main buffer and the snapshot buffer need to be the same for some tracers, otherwise it will fail and disable all tracing, the tracers need to be stopped while updating the sub buffer sizes so that the tracers see the main and snapshot buffers with the

[PATCH v5 08/15] ring-buffer: Make sure the spare sub buffer used for reads has same size

2023-12-19 Thread Steven Rostedt
From: "Steven Rostedt (Google)" Now that the ring buffer specifies the size of its sub buffers, they all need to be the same size. When doing a read, a swap is done with a spare page. Make sure they are the same size before doing the swap, otherwise the read will fail. Signed-off-by: Steven

[PATCH v5 07/15] ring-buffer: Do no swap cpu buffers if order is different

2023-12-19 Thread Steven Rostedt
From: "Steven Rostedt (Google)" As all the subbuffer order (subbuffer sizes) must be the same throughout the ring buffer, check the order of the buffers that are doing a CPU buffer swap in ring_buffer_swap_cpu() to make sure they are the same. If the are not the same, then fail to do the swap,

[PATCH v5 06/15] ring-buffer: Clear pages on error in ring_buffer_subbuf_order_set() failure

2023-12-19 Thread Steven Rostedt
From: "Steven Rostedt (Google)" On failure to allocate ring buffer pages, the pointer to the CPU buffer pages is freed, but the pages that were allocated previously were not. Make sure they are freed too. Fixes: TBD ("tracing: Set new size of the ring buffer sub page") Signed-off-by: Steven

[PATCH v5 04/15] ring-buffer: Set new size of the ring buffer sub page

2023-12-19 Thread Steven Rostedt
From: "Tzvetomir Stoyanov (VMware)" There are two approaches when changing the size of the ring buffer sub page: 1. Destroying all pages and allocating new pages with the new size. 2. Allocating new pages, copying the content of the old pages before destroying them. The first approach is

[PATCH v5 05/15] ring-buffer: Read and write to ring buffers with custom sub buffer size

2023-12-19 Thread Steven Rostedt
From: "Tzvetomir Stoyanov (VMware)" As the size of the ring sub buffer page can be changed dynamically, the logic that reads and writes to the buffer should be fixed to take that into account. Some internal ring buffer APIs are changed: ring_buffer_alloc_read_page()

[PATCH v5 03/15] ring-buffer: Add interface for configuring trace sub buffer size

2023-12-19 Thread Steven Rostedt
From: "Tzvetomir Stoyanov (VMware)" The trace ring buffer sub page size can be configured, per trace instance. A new ftrace file "buffer_subbuf_order" is added to get and set the size of the ring buffer sub page for current trace instance. The size must be an order of system page size, that's

[PATCH v5 02/15] ring-buffer: Page size per ring buffer

2023-12-19 Thread Steven Rostedt
From: "Tzvetomir Stoyanov (VMware)" Currently the size of one sub buffer page is global for all buffers and it is hard coded to one system page. In order to introduce configurable ring buffer sub page size, the internal logic should be refactored to work with sub page size per ring buffer.

[PATCH v5 01/15] ring-buffer: Refactor ring buffer implementation

2023-12-19 Thread Steven Rostedt
From: "Tzvetomir Stoyanov (VMware)" In order to introduce sub-buffer size per ring buffer, some internal refactoring is needed. As ring_buffer_print_page_header() will depend on the trace_buffer structure, it is moved after the structure definition. Link:

[PATCH v5 00/15] ring-buffer/tracing: Allow ring buffer to have bigger sub buffers

2023-12-19 Thread Steven Rostedt
Note, this has been on my todo list since the ring buffer was created back in 2008. Tzvetomir last worked on this in 2021 and I need to finally get it in. His last series was: https://lore.kernel.org/linux-trace-devel/20211213094825.61876-1-tz.stoya...@gmail.com/ With the description of:

[PATCH v8 2/2] tracing: Allow user-space mapping of the ring-buffer

2023-12-19 Thread Vincent Donnefort
Currently, user-space extracts data from the ring-buffer via splice, which is handy for storage or network sharing. However, due to splice limitations, it is imposible to do real-time analysis without a copy. A solution for that problem is to let the user-space map the ring-buffer directly. The

[PATCH v8 1/2] ring-buffer: Introducing ring-buffer mapping functions

2023-12-19 Thread Vincent Donnefort
In preparation for allowing the user-space to map a ring-buffer, add a set of mapping functions: ring_buffer_{map,unmap}() ring_buffer_map_fault() And controls on the ring-buffer: ring_buffer_map_get_reader() /* swap reader and head */ Mapping the ring-buffer also involves: A unique

[PATCH v8 0/2] Introducing trace buffer mapping by user-space

2023-12-19 Thread Vincent Donnefort
The tracing ring-buffers can be stored on disk or sent to network without any copy via splice. However the later doesn't allow real time processing of the traces. A solution is to give userspace direct access to the ring-buffer pages via a mapping. An application can now become a consumer of the

Re: [PATCH RFC 1/4] virtio-net: support transmit hash report

2023-12-19 Thread Michael S. Tsirkin
On Mon, Dec 18, 2023 at 12:37:08PM +0100, Steffen Trumtrar wrote: > diff --git a/include/uapi/linux/virtio_net.h b/include/uapi/linux/virtio_net.h > index cc65ef0f3c3e2..698a11f8c6ab9 100644 > --- a/include/uapi/linux/virtio_net.h > +++ b/include/uapi/linux/virtio_net.h > @@ -56,6 +56,7 @@ >

Re: [PATCH v5 4/4] vduse: Add LSM hook to check Virtio device type

2023-12-19 Thread Paul Moore
On Mon, Dec 18, 2023 at 12:21 PM Stephen Smalley wrote: > On Tue, Dec 12, 2023 at 8:17 AM Maxime Coquelin > wrote: > > This patch introduces a LSM hook for devices creation, > > destruction (ioctl()) and opening (open()) operations, > > checking the application is allowed to perform these > >

[PATCH vhost v4 15/15] vdpa/mlx5: Add mkey leak detection

2023-12-19 Thread Dragos Tatulea
Track allocated mrs in a list and show warning when leaks are detected on device free or reset. Reviewed-by: Gal Pressman Acked-by: Eugenio Pérez Signed-off-by: Dragos Tatulea --- drivers/vdpa/mlx5/core/mlx5_vdpa.h | 2 ++ drivers/vdpa/mlx5/core/mr.c| 23 +++

[PATCH vhost v4 14/15] vdpa/mlx5: Introduce reference counting to mrs

2023-12-19 Thread Dragos Tatulea
Deleting the old mr during mr update (.set_map) and then modifying the vqs with the new mr is not a good flow for firmware. The firmware expects that mkeys are deleted after there are no more vqs referencing them. Introduce reference counting for mrs to fix this. It is the only way to make sure

[PATCH vhost v4 13/15] vdpa/mlx5: Use vq suspend/resume during .set_map

2023-12-19 Thread Dragos Tatulea
Instead of tearing down and setting up vq resources, use vq suspend/resume during .set_map to speed things up a bit. The vq mr is updated with the new mapping while the vqs are suspended. If the device doesn't support resumable vqs, do the old teardown and setup dance. Reviewed-by: Gal Pressman

[PATCH vhost v4 12/15] vdpa/mlx5: Mark vq state for modification in hw vq

2023-12-19 Thread Dragos Tatulea
.set_vq_state will set the indices and mark the fields to be modified in the hw vq. Advertise that the device supports changing the vq state when the device is in DRIVER_OK state and suspended. Reviewed-by: Gal Pressman Signed-off-by: Dragos Tatulea --- drivers/vdpa/mlx5/net/mlx5_vnet.c | 11

[PATCH vhost v4 11/15] vdpa/mlx5: Mark vq addrs for modification in hw vq

2023-12-19 Thread Dragos Tatulea
Addresses get set by .set_vq_address. hw vq addresses will be updated on next modify_virtqueue. Advertise that the device supports changing the vq addresses when device is in DRIVER_OK state and suspended. Reviewed-by: Gal Pressman Signed-off-by: Dragos Tatulea ---

[PATCH vhost v4 10/15] vdpa/mlx5: Introduce per vq and device resume

2023-12-19 Thread Dragos Tatulea
Implement vdpa vq and device resume if capability detected. Add support for suspend -> ready state change. Reviewed-by: Gal Pressman Acked-by: Eugenio Pérez Signed-off-by: Dragos Tatulea --- drivers/vdpa/mlx5/net/mlx5_vnet.c | 69 +++ 1 file changed, 62

[PATCH vhost v4 08/15] vdpa: Block vq state change in DRIVER_OK unless device supports it

2023-12-19 Thread Dragos Tatulea
Virtqueue state change during DRIVE_OK is not supported by the virtio standard. Allow this op in DRIVER_OK only for devices that support changing the state during DRIVER_OK if the device is suspended. Signed-off-by: Dragos Tatulea Suggested-by: Eugenio Pérez --- drivers/vhost/vdpa.c | 6 ++

[PATCH vhost v4 09/15] vdpa/mlx5: Allow modifying multiple vq fields in one modify command

2023-12-19 Thread Dragos Tatulea
Add a bitmask variable that tracks hw vq field changes that are supposed to be modified on next hw vq change command. This will be useful to set multiple vq fields when resuming the vq. Reviewed-by: Gal Pressman Acked-by: Eugenio Pérez Signed-off-by: Dragos Tatulea ---

[PATCH vhost v4 07/15] vdpa: Block vq address change in DRIVER_OK unless device supports it

2023-12-19 Thread Dragos Tatulea
Virtqueue address change during DRIVE_OK is not supported by the virtio standard. Allow this op in DRIVER_OK only for devices that support changing the address during DRIVER_OK if the device is suspended. Signed-off-by: Dragos Tatulea Suggested-by: Eugenio Pérez --- drivers/vhost/vdpa.c | 26

[PATCH vhost v4 05/15] vdpa: Accept VHOST_BACKEND_F_CHANGEABLE_VQ_STATE_IN_SUSPEND backend feature

2023-12-19 Thread Dragos Tatulea
If userland sets this feature, allow it. Signed-off-by: Dragos Tatulea Suggested-by: Eugenio Pérez --- drivers/vhost/vdpa.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c index 2250fcd90e5b..b4e8ddf86485 100644 --- a/drivers/vhost/vdpa.c +++

[PATCH vhost v4 06/15] vdpa: Track device suspended state

2023-12-19 Thread Dragos Tatulea
Set vdpa device suspended state on successful suspend. Clear it on successful resume and reset. The state will be locked by the vhost_vdpa mutex. The mutex is taken during suspend, resume and reset in vhost_vdpa_unlocked_ioctl. The exception is vhost_vdpa_open which does a device reset but that

[PATCH vhost v4 04/15] vdpa: Accept VHOST_BACKEND_F_CHANGEABLE_VQ_ADDR_IN_SUSPEND backend feature

2023-12-19 Thread Dragos Tatulea
If userland sets this feature, allow it. Signed-off-by: Dragos Tatulea Suggested-by: Eugenio Pérez --- drivers/vhost/vdpa.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c index da7ec77cdaff..2250fcd90e5b 100644 --- a/drivers/vhost/vdpa.c +++

[PATCH vhost v4 03/15] vdpa: Add VHOST_BACKEND_F_CHANGEABLE_VQ_STATE_IN_SUSPEND flag

2023-12-19 Thread Dragos Tatulea
The virtio spec doesn't allow changing virtqueue state after DRIVER_OK. Some devices do support this operation when the device is suspended. The VHOST_BACKEND_F_CHANGEABLE_VQ_STATE_IN_SUSPEND flag advertises this support as a backend features. Signed-off-by: Dragos Tatulea Suggested-by: Eugenio

[PATCH vhost v4 02/15] vdpa: Add VHOST_BACKEND_F_CHANGEABLE_VQ_ADDR_IN_SUSPEND flag

2023-12-19 Thread Dragos Tatulea
The virtio spec doesn't allow changing virtqueue addresses after DRIVER_OK. Some devices do support this operation when the device is suspended. The VHOST_BACKEND_F_CHANGEABLE_VQ_ADDR_IN_SUSPEND flag advertises this support as a backend features. Signed-off-by: Dragos Tatulea Suggested-by:

[PATCH mlx5-vhost v4 01/15] vdpa/mlx5: Expose resumable vq capability

2023-12-19 Thread Dragos Tatulea
Necessary for checking if resumable vqs are supported by the hardware. Actual support will be added in a downstream patch. Reviewed-by: Gal Pressman Acked-by: Eugenio Pérez Signed-off-by: Dragos Tatulea --- include/linux/mlx5/mlx5_ifc.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)

[PATCH vhost v4 00/15] vdpa/mlx5: Add support for resumable vqs

2023-12-19 Thread Dragos Tatulea
Add support for resumable vqs in the mlx5_vdpa driver. This is a firmware feature that can be used for the following benefits: - Full device .suspend/.resume. - .set_map doesn't need to destroy and create new vqs anymore just to update the map. When resumable vqs are supported it is enough to

Re: [PATCH] ring-buffer: Fix slowpath of interrupted event

2023-12-19 Thread Steven Rostedt
On Tue, 19 Dec 2023 10:36:13 -0500 Steven Rostedt wrote: > |-- interrupt event --|-- normal context event --|-- interrupt event --| > > ^^ ^ > || | > ts is before before_stamp

Re: [PATCH v5 06/34] function_graph: Allow multiple users to attach to function graph

2023-12-19 Thread Google
On Tue, 19 Dec 2023 14:23:37 +0100 Jiri Olsa wrote: > On Mon, Dec 18, 2023 at 10:12:45PM +0900, Masami Hiramatsu (Google) wrote: > > SNIP > > > /* Both enabled by default (can be cleared by function_graph tracer flags > > */ > > static bool fgraph_sleep_time = true; > > > > @@ -126,9

Re: [PATCH v2] virtio_balloon: stay awake while adjusting balloon

2023-12-19 Thread David Hildenbrand
On 19.12.23 15:37, David Stevens wrote: On Mon, Dec 18, 2023 at 12:33 PM David Hildenbrand wrote: On 18.12.23 16:18, David Stevens wrote: From: David Stevens A virtio_balloon's parent device may be configured so that a configuration change interrupt is a wakeup event. Extend the processing

Re: [PATCH] ring-buffer: Fix slowpath of interrupted event

2023-12-19 Thread Steven Rostedt
On Tue, 19 Dec 2023 10:10:27 -0500 Steven Rostedt wrote: > 1000 - interrupt event > 2000 - normal context event > 2100 - next normal context event > > Where we see the delta between the interrupt event and the normal context > event was 1000. But if we just had it be delta = 0, it would be:

Re: [PATCH v6 2/4] dax/bus: Use guard(device) in sysfs attribute helpers

2023-12-19 Thread Jonathan Cameron
On Thu, 14 Dec 2023 22:25:27 -0700 Vishal Verma wrote: > Use the guard(device) macro to lock a 'struct device', and unlock it > automatically when going out of scope using Scope Based Resource > Management semantics. A lot of the sysfs attribute writes in > drivers/dax/bus.c benefit from a

Re: [PATCH vhost v2 4/8] vdpa/mlx5: Mark vq addrs for modification in hw vq

2023-12-19 Thread Dragos Tatulea
On Tue, 2023-12-19 at 15:02 +0100, Eugenio Perez Martin wrote: > On Tue, Dec 19, 2023 at 12:16 PM Dragos Tatulea wrote: > > > > On Tue, 2023-12-19 at 08:24 +0100, Eugenio Perez Martin wrote: > > > On Mon, Dec 18, 2023 at 2:58 PM Dragos Tatulea > > > wrote: > > > > > > > > On Mon, 2023-12-18

Re: [PATCH] ring-buffer: Fix slowpath of interrupted event

2023-12-19 Thread Steven Rostedt
On Tue, 19 Dec 2023 23:37:10 +0900 Masami Hiramatsu (Google) wrote: > Yeah the above works, but my question is, do we really need this > really slow path? I mean; > > > if (w == write - event length) { > > /* Nothing interrupted between A and C */ > > /*E*/

Re: [PATCH v5 28/34] fprobe: Rewrite fprobe on function-graph tracer

2023-12-19 Thread Jiri Olsa
On Mon, Dec 18, 2023 at 10:17:10PM +0900, Masami Hiramatsu (Google) wrote: SNIP > -static void fprobe_exit_handler(struct rethook_node *rh, void *data, > - unsigned long ret_ip, struct pt_regs *regs) > +static int fprobe_entry(unsigned long func, unsigned long ret_ip,

Re: [PATCH v2] virtio_balloon: stay awake while adjusting balloon

2023-12-19 Thread David Stevens
On Mon, Dec 18, 2023 at 12:33 PM David Hildenbrand wrote: > > On 18.12.23 16:18, David Stevens wrote: > > From: David Stevens > > > > A virtio_balloon's parent device may be configured so that a > > configuration change interrupt is a wakeup event. Extend the processing > > of such a wakeup

Re: [PATCH] ring-buffer: Fix slowpath of interrupted event

2023-12-19 Thread Google
On Mon, 18 Dec 2023 23:07:12 -0500 Steven Rostedt wrote: > From: "Steven Rostedt (Google)" > > To synchronize the timestamps with the ring buffer reservation, there are > two timestamps that are saved in the buffer meta data. > > 1. before_stamp > 2. write_stamp > > When the two are equal,

[PATCH] modules: wait do_free_init correctly

2023-12-19 Thread Changbin Du
The commit 1a7b7d922081 ("modules: Use vmalloc special flag") moves do_free_init() into a global workqueue instead of call_rcu(). So now we should wait it via flush_work(). Fixes: 1a7b7d922081 ("modules: Use vmalloc special flag") Signed-off-by: Changbin Du Cc: Xiaoyi Su ---

Re: [PATCH vhost v2 4/8] vdpa/mlx5: Mark vq addrs for modification in hw vq

2023-12-19 Thread Eugenio Perez Martin
On Tue, Dec 19, 2023 at 12:16 PM Dragos Tatulea wrote: > > On Tue, 2023-12-19 at 08:24 +0100, Eugenio Perez Martin wrote: > > On Mon, Dec 18, 2023 at 2:58 PM Dragos Tatulea wrote: > > > > > > On Mon, 2023-12-18 at 13:06 +0100, Eugenio Perez Martin wrote: > > > > On Mon, Dec 18, 2023 at 11:52 AM

Re: [PATCH v5 24/34] fprobe: Use ftrace_regs in fprobe entry handler

2023-12-19 Thread Jiri Olsa
On Mon, Dec 18, 2023 at 10:16:23PM +0900, Masami Hiramatsu (Google) wrote: SNIP > diff --git a/kernel/trace/bpf_trace.c b/kernel/trace/bpf_trace.c > index 84e8a0f6e4e0..d3f8745d8ead 100644 > --- a/kernel/trace/bpf_trace.c > +++ b/kernel/trace/bpf_trace.c > @@ -2503,7 +2503,7 @@ static int __init

Re: [PATCH v5 06/34] function_graph: Allow multiple users to attach to function graph

2023-12-19 Thread Jiri Olsa
On Mon, Dec 18, 2023 at 10:12:45PM +0900, Masami Hiramatsu (Google) wrote: SNIP > /* Both enabled by default (can be cleared by function_graph tracer flags */ > static bool fgraph_sleep_time = true; > > @@ -126,9 +247,34 @@ ftrace_push_return_trace(unsigned long ret, unsigned > long func, >

Re: [PATCH v5 24/34] fprobe: Use ftrace_regs in fprobe entry handler

2023-12-19 Thread Jiri Olsa
On Mon, Dec 18, 2023 at 10:16:23PM +0900, Masami Hiramatsu (Google) wrote: > From: Masami Hiramatsu (Google) > > This allows fprobes to be available with CONFIG_DYNAMIC_FTRACE_WITH_ARGS > instead of CONFIG_DYNAMIC_FTRACE_WITH_REGS, then we can enable fprobe > on arm64. > > Signed-off-by: Masami

[PATCH] ring-buffer: Check if absolute timestamp goes backwards

2023-12-19 Thread Steven Rostedt
From: "Steven Rostedt (Google)" The check_buffer() which checks the timestamps of the ring buffer sub-buffer page, when enabled, only checks if the adding of deltas of the events from the last absolute timestamp or the timestamp of the sub-buffer page adds up to the current event. What it does

[PATCH] ring-buffer: Add interrupt information to dump of data sub-buffer

2023-12-19 Thread Steven Rostedt
From: "Steven Rostedt (Google)" When the ring buffer timestamp verifier triggers, it dumps the content of the sub-buffer. But currently it only dumps the timestamps and the offset of the data as well as the deltas. It would be even more informative if the event data also showed the interrupt

[PATCH v3] ring-buffer: Remove 32bit timestamp logic

2023-12-19 Thread Steven Rostedt
From: "Steven Rostedt (Google)" Each event has a 27 bit timestamp delta that is used to hold the delta from the last event. If the time between events is greater than 2^27, then a timestamp is added that holds a 59 bit absolute timestamp. Until a389d86f7fd09 ("ring-buffer: Have nested events

Re: [PATCH vhost v2 4/8] vdpa/mlx5: Mark vq addrs for modification in hw vq

2023-12-19 Thread Dragos Tatulea
On Tue, 2023-12-19 at 08:24 +0100, Eugenio Perez Martin wrote: > On Mon, Dec 18, 2023 at 2:58 PM Dragos Tatulea wrote: > > > > On Mon, 2023-12-18 at 13:06 +0100, Eugenio Perez Martin wrote: > > > On Mon, Dec 18, 2023 at 11:52 AM Dragos Tatulea > > > wrote: > > > > > > > > On Mon, 2023-12-18

Re: [PATCH v4 2/2] leds: qcom-lpg: Add PM660L configuration and compatible

2023-12-19 Thread Marijn Suijten
On 2023-12-19 10:33:25, Johan Hovold wrote: > On Tue, Dec 19, 2023 at 10:17:16AM +0100, Marijn Suijten wrote: > > > Note that I have one more unmerged leds patch around, that hasn't been > > looked > > at either. Would it help to send this once again, perhaps with more > > reviewers/ > >

Re: [PATCH v4 2/2] leds: qcom-lpg: Add PM660L configuration and compatible

2023-12-19 Thread Marijn Suijten
Hi Johan and Lee, On 2023-12-19 09:22:43, Johan Hovold wrote: > Hi Marijn and Lee, > > On Tue, Jul 19, 2022 at 11:18:48PM +0200, Marijn Suijten wrote: > > Inherit PM660L PMIC LPG/triled block configuration from downstream > > drivers and DT sources, consisting of a triled block with automatic >

Re: [PATCH v4 2/2] leds: qcom-lpg: Add PM660L configuration and compatible

2023-12-19 Thread Johan Hovold
On Tue, Dec 19, 2023 at 10:17:16AM +0100, Marijn Suijten wrote: > Note that I have one more unmerged leds patch around, that hasn't been looked > at either. Would it help to send this once again, perhaps with more > reviewers/ > testing (Johan, would you mind taking a look too)? > >

Re: [PATCH 0/2] kmod /usr support

2023-12-19 Thread Masahiro Yamada
On Thu, Dec 7, 2023 at 3:37 AM Lucas De Marchi wrote: > > On Fri, Nov 10, 2023 at 01:13:53PM +0100, Michal Suchanek wrote: > >Hello, > > > >This is resend of the last patch in the series that adds prefix support > >to kernel module location together with additional patch for validating > >the

Re: [PATCH v4 2/2] leds: qcom-lpg: Add PM660L configuration and compatible

2023-12-19 Thread Johan Hovold
Hi Marijn and Lee, On Tue, Jul 19, 2022 at 11:18:48PM +0200, Marijn Suijten wrote: > Inherit PM660L PMIC LPG/triled block configuration from downstream > drivers and DT sources, consisting of a triled block with automatic > trickle charge control and source selection, three colored led channels >