Re: [PATCH v2] mm: Update mark_victim tracepoints fields

2024-02-20 Thread Michal Hocko
Hi, sorry I have missed this before. On Thu 11-01-24 21:05:30, Carlos Galo wrote: > The current implementation of the mark_victim tracepoint provides only > the process ID (pid) of the victim process. This limitation poses > challenges for userspace tools that need additional information > about

Re: [PATCH -next v6 0/2] Make memory reclamation measurable

2024-02-20 Thread Michal Hocko
On Wed 21-02-24 11:00:53, Bixuan Cui wrote: > > > 在 2024/2/21 10:22, Steven Rostedt 写道: > > It's up to the memory management folks to decide on this. -- Steve > Noted with thanks. It would be really helpful to have more details on why we need those trace points. It is my understanding that you

Re: [PATCH v9 08/15] x86/sgx: Implement EPC reclamation flows for cgroup

2024-02-20 Thread Haitao Huang
[...] Here the @nr_to_scan is reduced by the number of pages that are isolated, but not actually reclaimed (which is reflected by @cnt). IIUC, looks you want to make this function do "each cycle" as what you mentioned in the v8 [1]: I tested with that approach and found we can

Re: [PATCH v9 08/15] x86/sgx: Implement EPC reclamation flows for cgroup

2024-02-20 Thread Haitao Huang
StartHi Kai On Tue, 20 Feb 2024 03:52:39 -0600, Huang, Kai wrote: [...] So you introduced the work/workqueue here but there's no place which actually queues the work. IMHO you can either: 1) move relevant code change here; or 2) focus on introducing core functions to reclaim certain pages

Re: [PATCH] bus: mhi: host: Change the trace string for the userspace tools mapping

2024-02-20 Thread Manivannan Sadhasivam
On Sun, Feb 18, 2024 at 02:13:39PM +0530, Krishna chaitanya chundru wrote: > User space tools can't map strings if we use directly, as the string > address is internal to kernel. > > So add trace point strings for the user space tools to map strings > properly. > > Signed-off-by: Krishna

Re: [PATCH v3] modules: wait do_free_init correctly

2024-02-20 Thread Eric Chanudet
On Sun, Feb 18, 2024 at 01:21:53PM -0800, Andrew Morton wrote: > On Sat, 17 Feb 2024 16:18:10 +0800 Changbin Du wrote: > > The synchronization here is just to ensure the module init's been freed > > before doing W+X checking. But the commit 1a7b7d922081 ("modules: Use > > vmalloc special flag")

Re: [PATCH -next v6 0/2] Make memory reclamation measurable

2024-02-20 Thread Bixuan Cui
在 2024/2/21 10:22, Steven Rostedt 写道: It's up to the memory management folks to decide on this. -- Steve Noted with thanks. Bixuan Cui

Re: [PATCH -next v6 0/2] Make memory reclamation measurable

2024-02-20 Thread Steven Rostedt
On Wed, 21 Feb 2024 09:44:32 +0800 Bixuan Cui wrote: > ping~ > It's up to the memory management folks to decide on this. -- Steve > 在 2024/1/5 9:36, Bixuan Cui 写道: > > When the system memory is low, kswapd reclaims the memory. The key steps > > of memory reclamation include > >

Re: [PATCH -next v6 0/2] Make memory reclamation measurable

2024-02-20 Thread Bixuan Cui
ping~ 在 2024/1/5 9:36, 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

Re: [PATCH v3] ring-buffer: Simplify reservation with try_cmpxchg() loop

2024-02-20 Thread Steven Rostedt
On Tue, 20 Feb 2024 10:40:23 -0500 Steven Rostedt wrote: > > Try resetting the info->add_timestamp flags to add_ts_default on goto again > > within __rb_reserve_next(). > > > > I was looking at that too, but I don't know how it will make a difference. > > Note, the test that fails is in my

[PATCH v18 5/6] Documentation: tracing: Add ring-buffer mapping

2024-02-20 Thread Vincent Donnefort
It is now possible to mmap() a ring-buffer to stream its content. Add some documentation and a code example. Signed-off-by: Vincent Donnefort diff --git a/Documentation/trace/index.rst b/Documentation/trace/index.rst index 5092d6c13af5..0b300901fd75 100644 --- a/Documentation/trace/index.rst

[PATCH v18 3/6] tracing: Add snapshot refcount

2024-02-20 Thread Vincent Donnefort
When a ring-buffer is memory mapped by user-space, no trace or ring-buffer swap is possible. This means the snapshot feature is mutually exclusive with the memory mapping. Having a refcount on snapshot users will help to know if a mapping is possible or not. Instead of relying on the global

[PATCH v18 4/6] tracing: Allow user-space mapping of the ring-buffer

2024-02-20 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 v18 2/6] ring-buffer: Introducing ring-buffer mapping functions

2024-02-20 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 v18 1/6] ring-buffer: Zero ring-buffer sub-buffers

2024-02-20 Thread Vincent Donnefort
In preparation for the ring-buffer memory mapping where each subbuf will be accessible to user-space, zero all the page allocations. Signed-off-by: Vincent Donnefort Reviewed-by: Masami Hiramatsu (Google) diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c index

[PATCH v18 0/6] Introducing trace buffer mapping by user-space

2024-02-20 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: Re: [PATCH v9 08/15] x86/sgx: Implement EPC reclamation flows for cgroup

2024-02-20 Thread Huang, Kai
On Tue, 2024-02-20 at 14:18 +0100, Michal Koutný wrote: > On Tue, Feb 20, 2024 at 09:52:39AM +, "Huang, Kai" > wrote: > > I am not sure, but is it possible or legal for an ancestor to have less > > limit > > than children? > > Why not? > It is desired for proper hiearchical delegation and

Re: [PATCH v3 1/7] remoteproc: Add TEE support

2024-02-20 Thread Mathieu Poirier
Good morning, On Wed, Feb 14, 2024 at 06:21:21PM +0100, Arnaud Pouliquen wrote: > From: Arnaud Pouliquen > > Add a remoteproc TEE (Trusted Execution Environment) driver > that will be probed by the TEE bus. If the associated Trusted > application is supported on secure part this device offers a

Re: [PATCH] MAINTAINERS: add memory mapping entry with reviewers

2024-02-20 Thread Vlastimil Babka
On 2/20/24 07:44, Lorenzo Stoakes wrote: > Recently there have been a number of patches which have affected various > aspects of the memory mapping logic as implemented in mm/mmap.c where it > would have been useful for regular contributors to have been notified. > > Add an entry for this part of

Re: [PATCH v5 0/4] Add samsung-matisselte and common matisse dtsi

2024-02-20 Thread Bjorn Andersson
On Tue, 31 Oct 2023 15:00:54 +0100, Stefan Hansson wrote: > This series adds a common samsung-matisse dtsi and reworks > samsung-matisse-wifi to use it, and introduces samsung-matisselte. I > choose matisselte over matisse-lte as this is how most other devices > (klte, s3ve3g) do it and it is

[RFC PATCH 11/14] csky/thread_info: Introduce TIF_NOTIFY_IPI flag

2024-02-20 Thread K Prateek Nayak
Add support for TIF_NOTIFY_IPI on C-SKY. With TIF_NOTIFY_IPI, a sender sending an IPI to an idle CPU in TIF_POLLING mode will set the TIF_NOTIFY_IPI flag in the target's idle tasks's thread_info to pull the CPU out of idle, as opposed to setting TIF_NEED_RESCHED previously. This avoids spurious

[RFC PATCH 07/14] openrisc/thread_info: Introduce TIF_NOTIFY_IPI flag

2024-02-20 Thread K Prateek Nayak
Add support for TIF_NOTIFY_IPI on OpenRISC. With TIF_NOTIFY_IPI, a sender sending an IPI to an idle CPU in TIF_POLLING mode will set the TIF_NOTIFY_IPI flag in the target's idle tasks's thread_info to pull the CPU out of idle, as opposed to setting TIF_NEED_RESCHED previously. This avoids spurious

Re: [PATCH v3] ring-buffer: Simplify reservation with try_cmpxchg() loop

2024-02-20 Thread Steven Rostedt
On Tue, 20 Feb 2024 09:50:13 -0500 Mathieu Desnoyers wrote: > On 2024-02-20 09:19, Steven Rostedt wrote: > > On Mon, 19 Feb 2024 18:20:32 -0500 > > Steven Rostedt wrote: > > > >> Instead of using local_add_return() to reserve the ring buffer data, > >> Mathieu Desnoyers suggested using

Re: [PATCH v3] ring-buffer: Simplify reservation with try_cmpxchg() loop

2024-02-20 Thread Mathieu Desnoyers
On 2024-02-20 09:19, Steven Rostedt wrote: On Mon, 19 Feb 2024 18:20:32 -0500 Steven Rostedt wrote: Instead of using local_add_return() to reserve the ring buffer data, Mathieu Desnoyers suggested using local_cmpxchg(). This would simplify the reservation with the time keeping code.

[PATCH] ring-buffer: Do not let subbuf be bigger than write mask

2024-02-20 Thread Steven Rostedt
From: "Steven Rostedt (Google)" The data on the subbuffer is measured by a write variable that also contains status flags. The counter is just 20 bits in length. If the subbuffer is bigger than then counter, it will fail. Make sure that the subbuffer can not be set to greater than the counter

Re: [PATCH v3] ring-buffer: Simplify reservation with try_cmpxchg() loop

2024-02-20 Thread Steven Rostedt
On Mon, 19 Feb 2024 18:20:32 -0500 Steven Rostedt wrote: > Instead of using local_add_return() to reserve the ring buffer data, > Mathieu Desnoyers suggested using local_cmpxchg(). This would simplify the > reservation with the time keeping code. > > Although, it does not get rid of the double

[PATCH v4 3/3] tracing: Move saved_cmdline code into trace_sched_switch.c

2024-02-20 Thread Steven Rostedt
From: "Steven Rostedt (Google)" The code that handles saved_cmdlines is split between the trace.c file and the trace_sched_switch.c. There's some history to this. The trace_sched_switch.c was originally created to handle the sched_switch tracer that was deprecated due to sched_switch trace event

[PATCH v4 2/3] tracing: Move open coded processing of tgid_map into helper function

2024-02-20 Thread Steven Rostedt
From: "Steven Rostedt (Google)" In preparation of moving the saved_cmdlines logic out of trace.c and into trace_sched_switch.c, replace the open coded manipulation of tgid_map in set_tracer_flag() into a helper function trace_alloc_tgid_map() so that it can be easily moved into

[PATCH v4 1/3] tracing: Have saved_cmdlines arrays all in one allocation

2024-02-20 Thread Steven Rostedt
From: "Steven Rostedt (Google)" The saved_cmdlines have three arrays for mapping PIDs to COMMs: - map_pid_to_cmdline[] - map_cmdline_to_pid[] - saved_cmdlines The map_pid_to_cmdline[] is PID_MAX_DEFAULT in size and holds the index into the other arrays. The map_cmdline_to_pid[] is a mapping

[PATCH v4 0/3] tracing: Changes to saved_cmdlines

2024-02-20 Thread Steven Rostedt
The first patch is to consolidate the map_cmdline_to_pid into the allocate page for the saved_cmdlines structure. The second patch removes some open coded saved_cmdlines logic in trace.c into a helper function to make it a cleaner move. The third patch simply moves code around. The goal is to

Re: Re: [PATCH v9 08/15] x86/sgx: Implement EPC reclamation flows for cgroup

2024-02-20 Thread Michal Koutný
On Tue, Feb 20, 2024 at 09:52:39AM +, "Huang, Kai" wrote: > I am not sure, but is it possible or legal for an ancestor to have less limit > than children? Why not? It is desired for proper hiearchical delegation and the tightest limit of ancestors applies (cf memory.max). Michal

[PATCH] arm64: dts: qcom: sdm632-fairphone-fp3: enable USB-C port handling

2024-02-20 Thread Luca Weiss
status = "okay"; vmmc-supply = <_l8>; @@ -286,8 +313,8 @@ { status = "okay"; }; -_dwc3 { - dr_mode = "peripheral"; +_dwc3_hs { + remote-endpoint = <_hs_in>; }; { --- base-commit: 103eb8e019aefd616735200ce46833bc74cfe132 change-id: 20240220-fp3-typec-25eb002db8b5 Best regards, -- Luca Weiss

[PATCH v19 3/3] vfio/nvgrace-gpu: Add vfio pci variant module for grace hopper

2024-02-20 Thread ankita
From: Ankit Agrawal NVIDIA's upcoming Grace Hopper Superchip provides a PCI-like device for the on-chip GPU that is the logical OS representation of the internal proprietary chip-to-chip cache coherent interconnect. The device is peculiar compared to a real PCI device in that whilst there is a

[PATCH v19 2/3] vfio/pci: rename and export range_intersect_range

2024-02-20 Thread ankita
From: Ankit Agrawal range_intersect_range determines an overlap between two ranges. If an overlap, the helper function returns the overlapping offset and size. The VFIO PCI variant driver emulates the PCI config space BAR offset registers. These offset may be accessed for read/write with a

[PATCH v19 1/3] vfio/pci: rename and export do_io_rw()

2024-02-20 Thread ankita
From: Ankit Agrawal do_io_rw() is used to read/write to the device MMIO. The grace hopper VFIO PCI variant driver require this functionality to read/write to its memory. Rename this as vfio_pci_core functions and export as GPL. Reviewed-by: Kevin Tian Reviewed-by: Yishai Hadas Signed-off-by:

[PATCH v19 0/3] vfio/nvgrace-gpu: Add vfio pci variant module for grace hopper

2024-02-20 Thread ankita
From: Ankit Agrawal NVIDIA's upcoming Grace Hopper Superchip provides a PCI-like device for the on-chip GPU that is the logical OS representation of the internal proprietary chip-to-chip cache coherent interconnect. The device is peculiar compared to a real PCI device in that whilst there is a

Re: [PATCH v9 08/15] x86/sgx: Implement EPC reclamation flows for cgroup

2024-02-20 Thread Huang, Kai
> +/* > + * Get the lower bound of limits of a cgroup and its ancestors. Used in > + * sgx_epc_cgroup_reclaim_work_func() to determine if EPC usage of a cgroup > is > + * over its limit or its ancestors' hence reclamation is needed. > + */ > +static inline u64

Re: [PATCH v9 07/15] x86/sgx: Expose sgx_reclaim_pages() for cgroup

2024-02-20 Thread Huang, Kai
On Mon, 2024-02-05 at 13:06 -0800, Haitao Huang wrote: > From: Sean Christopherson > > Each EPC cgroup will have an LRU structure to track reclaimable EPC pages. > When a cgroup usage reaches its limit, the cgroup needs to reclaim pages > from its LRU or LRUs of its descendants to make room for

Re: [PATCH] vduse: implement DMA sync callbacks

2024-02-20 Thread Christoph Hellwig
On Mon, Feb 19, 2024 at 06:06:06PM +0100, Maxime Coquelin wrote: > Since commit 295525e29a5b ("virtio_net: merge dma > operations when filling mergeable buffers"), VDUSE device > require support for DMA's .sync_single_for_cpu() operation > as the memory is non-coherent between the device and CPU >

Re: WARNING in shmem_release_dquot

2024-02-20 Thread Carlos Maiolino
On Mon, Feb 19, 2024 at 08:26:20PM -0800, Hugh Dickins wrote: > On Mon, 29 Jan 2024, Ubisectech Sirius wrote: > > > Hello. > > We are Ubisectech Sirius Team, the vulnerability lab of China ValiantSec. > > Recently, our team has discovered a issue in Linux kernel > > 6.8.0-rc1-gecb1b8288dc7.