Re: [PATCH RFC v3 28/35] arm64: mte: swap: Handle tag restoring when missing tag storage

2024-02-02 Thread Peter Collingbourne
en a page is swapped in and there are tags > > > associated > > > with the swap entry which the new page will replace. The saved tags are > > > restored even if the page will not be mapped as tagged, to protect against > > > cases where the page is shared between different VMA

Re: [PATCH RFC v3 28/35] arm64: mte: swap: Handle tag restoring when missing tag storage

2024-02-02 Thread Evgenii Stepanov
en a page is swapped in and there are tags > > > associated > > > with the swap entry which the new page will replace. The saved tags are > > > restored even if the page will not be mapped as tagged, to protect against > > > cases where the page is shared between different VMA

Re: [PATCH RFC v3 28/35] arm64: mte: swap: Handle tag restoring when missing tag storage

2024-02-02 Thread Alexandru Elisei
Hi Peter, On Thu, Feb 01, 2024 at 08:02:40PM -0800, Peter Collingbourne wrote: > On Thu, Jan 25, 2024 at 8:45 AM Alexandru Elisei > wrote: > > > > Linux restores tags when a page is swapped in and there are tags associated > > with the swap entry which the new page will

Re: [PATCH RFC v3 28/35] arm64: mte: swap: Handle tag restoring when missing tag storage

2024-02-01 Thread Peter Collingbourne
On Thu, Jan 25, 2024 at 8:45 AM Alexandru Elisei wrote: > > Linux restores tags when a page is swapped in and there are tags associated > with the swap entry which the new page will replace. The saved tags are > restored even if the page will not be mapped as tagged, to protect aga

[PATCH AUTOSEL 6.7 13/39] ring-buffer: Do no swap cpu buffers if order is different

2024-01-28 Thread Sasha Levin
From: "Steven Rostedt (Google)" [ Upstream commit b81e03a24966dca0b119eff0549a4e44befff419 ] 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

[PATCH RFC v3 28/35] arm64: mte: swap: Handle tag restoring when missing tag storage

2024-01-25 Thread Alexandru Elisei
Linux restores tags when a page is swapped in and there are tags associated with the swap entry which the new page will replace. The saved tags are restored even if the page will not be mapped as tagged, to protect against cases where the page is shared between different VMAs, and is tagged

[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 d

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

2023-12-15 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 d

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

2023-12-13 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 d

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

2023-12-09 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 d

[PATCH RFC v2 22/27] arm64: mte: swap: Handle tag restoring when missing tag storage

2023-11-19 Thread Alexandru Elisei
Linux restores tags when a page is swapped in and there are tags associated with the swap entry which the new page will replace. The saved tags are restored even if the page will not be mapped as tagged, to protect against cases where the page is shared between different VMAs, and is tagged

Re: [PATCH v2 2/3] usb: typec: fsa4480: Add support to swap SBU orientation

2023-10-30 Thread Heikki Krogerus
n the driver needs to be reversed to match the expectation of > the OCP96011 hardware. > > Support parsing the data-lanes parameter in the endpoint node to swap > this in the driver. > > The parse_data_lanes_mapping function is mostly taken from nb7vpq904m.c. > > Reviewed-b

[PATCH v2 2/3] usb: typec: fsa4480: Add support to swap SBU orientation

2023-10-20 Thread Luca Weiss
parameter in the endpoint node to swap this in the driver. The parse_data_lanes_mapping function is mostly taken from nb7vpq904m.c. Reviewed-by: Neil Armstrong Signed-off-by: Luca Weiss --- drivers/usb/typec/mux/fsa4480.c | 71 + 1 file changed, 71 insertions

Re: [PATCH 2/3] usb: typec: fsa4480: Add support to swap SBU orientation

2023-10-18 Thread Heikki Krogerus
Hi Luca, > > Shouldn't you loop through the endpoints? In any case: > > > > ep = fwnode_graph_get_next_endpoint(dev_fwnode(>client->dev, > > NULL)); > > The docs only mention one endpoint so I'm assuming just next_endpoint is > fine? I'm mostly concerned about what we may have in the

Re: [PATCH 2/3] usb: typec: fsa4480: Add support to swap SBU orientation

2023-10-17 Thread Luca Weiss
to SBU1 and AUX- to SBU2. > > > > So if OCP96011 is used as drop-in for FSA4480 then the orientation > > handling in the driver needs to be reversed to match the expectation of > > the OCP96011 hardware. > > > > Support parsing the data-lanes parameter in the

Re: [PATCH 2/3] usb: typec: fsa4480: Add support to swap SBU orientation

2023-10-17 Thread Heikki Krogerus
> handling in the driver needs to be reversed to match the expectation of > the OCP96011 hardware. > > Support parsing the data-lanes parameter in the endpoint node to swap > this in the driver. > > The parse_data_lanes_mapping function is mostly taken from nb7vpq904m.c. > >

Re: [PATCH 2/3] usb: typec: fsa4480: Add support to swap SBU orientation

2023-10-13 Thread Neil Armstrong
hardware. Support parsing the data-lanes parameter in the endpoint node to swap this in the driver. The parse_data_lanes_mapping function is mostly taken from nb7vpq904m.c. I see the inspiration :-) Signed-off-by: Luca Weiss --- drivers/usb/typec/mux/fsa4480.c | 81

[PATCH 2/3] usb: typec: fsa4480: Add support to swap SBU orientation

2023-10-13 Thread Luca Weiss
parameter in the endpoint node to swap this in the driver. The parse_data_lanes_mapping function is mostly taken from nb7vpq904m.c. Signed-off-by: Luca Weiss --- drivers/usb/typec/mux/fsa4480.c | 81 + 1 file changed, 81 insertions(+) diff --git a/drivers/usb

Re: [PATCH v3 3/4] mm/swap: remove confusing checking for non_swap_entry() in swap_ra_info()

2021-04-20 Thread Huang, Ying
Miaohe Lin writes: > The non_swap_entry() was used for working with VMA based swap readahead > via commit ec560175c0b6 ("mm, swap: VMA based swap readahead"). At that time, the non_swap_entry() checking is necessary because the function is called before checking that

Re: [PATCH v3 2/4] swap: fix do_swap_page() race with swapoff

2021-04-20 Thread Huang, Ying
Miaohe Lin writes: > When I was investigating the swap code, I found the below possible race > window: > > CPU 1 CPU 2 > - - > do_swap_page > if (data_race(si->flags & SWP_SYNCH

[PATCH v3 0/4] close various race windows for swap

2021-04-20 Thread Miaohe Lin
Hi all, When I was investigating the swap code, I found some possible race windows. This series aims to fix all these races. But using current get/put_swap_device() to guard against concurrent swapoff for swap_readpage() looks terrible because swap_readpage() may take really long time

[PATCH v3 2/4] swap: fix do_swap_page() race with swapoff

2021-04-20 Thread Miaohe Lin
When I was investigating the swap code, I found the below possible race window: CPU 1 CPU 2 - - do_swap_page if (data_race(si->flags & SWP_SYNCHRONOUS_IO) swap_readpage if (data_race(sis

[PATCH v3 3/4] mm/swap: remove confusing checking for non_swap_entry() in swap_ra_info()

2021-04-20 Thread Miaohe Lin
The non_swap_entry() was used for working with VMA based swap readahead via commit ec560175c0b6 ("mm, swap: VMA based swap readahead"). Then it's moved to swap_ra_info() since commit eaf649ebc3ac ("mm: swap: clean up swap readahead"). But this makes the code confusing. The no

Re: [PATCH v2 1/5] mm/swapfile: add percpu_ref support for swap

2021-04-19 Thread Miaohe Lin
t;>>>>> We will use percpu-refcount to serialize against concurrent swapoff. This >>>>>> patch adds the percpu_ref support for swap. >>>>>> >>>>>> Signed-off-by: Miaohe Lin >>>>>> --- >>>>>> include/linux/sw

Re: [PATCH v2 1/5] mm/swapfile: add percpu_ref support for swap

2021-04-19 Thread Huang, Ying
Miaohe Lin writes: > On 2021/4/19 15:09, Huang, Ying wrote: >> Miaohe Lin writes: >> >>> On 2021/4/19 10:48, Huang, Ying wrote: >>>> Miaohe Lin writes: >>>> >>>>> We will use percpu-refcount to serialize against concurrent

Re: [PATCH v2 1/5] mm/swapfile: add percpu_ref support for swap

2021-04-19 Thread Miaohe Lin
On 2021/4/19 15:09, Huang, Ying wrote: > Miaohe Lin writes: > >> On 2021/4/19 10:48, Huang, Ying wrote: >>> Miaohe Lin writes: >>> >>>> We will use percpu-refcount to serialize against concurrent swapoff. This >>>> patch adds the percpu_ref

Re: [PATCH v2 1/5] mm/swapfile: add percpu_ref support for swap

2021-04-19 Thread Huang, Ying
Miaohe Lin writes: > On 2021/4/19 10:48, Huang, Ying wrote: >> Miaohe Lin writes: >> >>> We will use percpu-refcount to serialize against concurrent swapoff. This >>> patch adds the percpu_ref support for swap. >>> >>> Signed-off-by:

Re: [PATCH v2 3/5] swap: fix do_swap_page() race with swapoff

2021-04-19 Thread Miaohe Lin
On 2021/4/19 10:23, Huang, Ying wrote: > Miaohe Lin writes: > >> When I was investigating the swap code, I found the below possible race >> window: >> >> CPU 1CPU 2 >> --

Re: [PATCH v2 4/5] mm/swap: remove confusing checking for non_swap_entry() in swap_ra_info()

2021-04-19 Thread Miaohe Lin
On 2021/4/19 9:53, Huang, Ying wrote: > Miaohe Lin writes: > >> While we released the pte lock, somebody else might faulted in this pte. >> So we should check whether it's swap pte first to guard against such race >> or swp_type would be unexpected. But t

Re: [PATCH v2 1/5] mm/swapfile: add percpu_ref support for swap

2021-04-19 Thread Miaohe Lin
On 2021/4/19 10:48, Huang, Ying wrote: > Miaohe Lin writes: > >> We will use percpu-refcount to serialize against concurrent swapoff. This >> patch adds the percpu_ref support for swap. >> >> Signed-off-by: Miaohe Lin >> --- >> include/linux/swa

Re: [PATCH v2 1/5] mm/swapfile: add percpu_ref support for swap

2021-04-18 Thread Huang, Ying
Miaohe Lin writes: > We will use percpu-refcount to serialize against concurrent swapoff. This > patch adds the percpu_ref support for swap. > > Signed-off-by: Miaohe Lin > --- > include/linux/swap.h | 3 +++ > mm/swapfile.c| 33 + &

Re: [PATCH v2 3/5] swap: fix do_swap_page() race with swapoff

2021-04-18 Thread Huang, Ying
Miaohe Lin writes: > When I was investigating the swap code, I found the below possible race > window: > > CPU 1 CPU 2 > - - > do_swap_page This is OK for swap cache cases. So if (d

Re: [PATCH v2 4/5] mm/swap: remove confusing checking for non_swap_entry() in swap_ra_info()

2021-04-18 Thread Huang, Ying
Miaohe Lin writes: > While we released the pte lock, somebody else might faulted in this pte. > So we should check whether it's swap pte first to guard against such race > or swp_type would be unexpected. But the swap_entry isn't used in this > function and we will have enough chec

[PATCH v2 0/5] close various race windows for swap

2021-04-17 Thread Miaohe Lin
Hi all, When I was investigating the swap code, I found some possible race windows. This series aims to fix all these races. But using current get/put_swap_device() to guard against concurrent swapoff for swap_readpage() looks terrible because swap_readpage() may take really long time

[PATCH v2 3/5] swap: fix do_swap_page() race with swapoff

2021-04-17 Thread Miaohe Lin
When I was investigating the swap code, I found the below possible race window: CPU 1 CPU 2 - - do_swap_page swap_readpage(skip swap cache case) if (data_race(sis->flags & SWP

[PATCH v2 4/5] mm/swap: remove confusing checking for non_swap_entry() in swap_ra_info()

2021-04-17 Thread Miaohe Lin
While we released the pte lock, somebody else might faulted in this pte. So we should check whether it's swap pte first to guard against such race or swp_type would be unexpected. But the swap_entry isn't used in this function and we will have enough checking when we really operate the PTE entries

[PATCH v2 1/5] mm/swapfile: add percpu_ref support for swap

2021-04-17 Thread Miaohe Lin
We will use percpu-refcount to serialize against concurrent swapoff. This patch adds the percpu_ref support for swap. Signed-off-by: Miaohe Lin --- include/linux/swap.h | 3 +++ mm/swapfile.c| 33 + 2 files changed, 32 insertions(+), 4 deletions(-) diff

Re: [PATCH 1/5] mm/swapfile: add percpu_ref support for swap

2021-04-16 Thread Miaohe Lin
gt;>>>> We will use percpu-refcount to serialize against concurrent >>>>>>>>>>>>>>>> swapoff. This >>>>>>>>>>>>>>>> patch adds the percpu_ref support for later fixup. >>>>>>>>>

Re: [PATCH 1/5] mm/swapfile: add percpu_ref support for swap

2021-04-16 Thread Huang, Ying
gt;>>> swapoff. This >>>>>>>>>>>>>>> patch adds the percpu_ref support for later fixup. >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> Signed-off-by: Miaohe Lin >>>>>>>>>&

Re: [PATCH 1/5] mm/swapfile: add percpu_ref support for swap

2021-04-15 Thread Miaohe Lin
gt;>>>>>>>>>>> We will use percpu-refcount to serialize against concurrent >>>>>>>>>>>>>> swapoff. This >>>>>>>>>>>>>> patch adds the percpu_ref support for later f

Re: [PATCH 1/5] mm/swapfile: add percpu_ref support for swap

2021-04-15 Thread Huang, Ying
adds the percpu_ref support for later fixup. >> >> >> >> >>>>>> >> >> >> >> >>>>>> Signed-off-by: Miaohe Lin >> >> >> >> >>>>>> --- >> >> >&

Re: [PATCH 1/5] mm/swapfile: add percpu_ref support for swap

2021-04-15 Thread Dennis Zhou
;> >>>>>> Signed-off-by: Miaohe Lin > >> >> >> >>>>>> --- > >> >> >> >>>>>> include/linux/swap.h | 2 ++ > >> >> >> >>>>>> mm/swapfile.c| 25 +++

Re: [PATCH 1/5] mm/swapfile: add percpu_ref support for swap

2021-04-15 Thread Miaohe Lin
gt;>>>>>>>>>>>> We will use percpu-refcount to serialize against concurrent >>>>>>>>>>>>>> swapoff. This >>>>>>>>>>>>>> patch adds the percpu_ref support for later fixup.

Re: [PATCH 1/5] mm/swapfile: add percpu_ref support for swap

2021-04-14 Thread Huang, Ying
>>> patch adds the percpu_ref support for later fixup. >> >> >> >>>>>> >> >> >> >>>>>> Signed-off-by: Miaohe Lin >> >> >> >>>>>> --- >> >> >> >>>>>> include/linux/swap.h

Re: [PATCH 1/5] mm/swapfile: add percpu_ref support for swap

2021-04-14 Thread Dennis Zhou
ize against concurrent > >>>>>>>>>>>> swapoff. This > >>>>>>>>>>>> patch adds the percpu_ref support for later fixup. > >>>>>>>>>>>> > >>>>>>>>>>>> Signed-o

Re: [PATCH 2/5] swap: fix do_swap_page() race with swapoff

2021-04-14 Thread Miaohe Lin
blame` >>>> find out the correct commit. For this it's commit 0bcac06f27d7 "mm, >>>> swap: skip swapcache for swapin of synchronous device". >>>> >>>> And I suggest to merge 1/5 and 2/5 to make it easy to get the full >>>> picture. &g

Re: [PATCH 1/5] mm/swapfile: add percpu_ref support for swap

2021-04-14 Thread Miaohe Lin
ter fixup. >>>>>>>>>>>> >>>>>>>>>>>> Signed-off-by: Miaohe Lin >>>>>>>>>>>> --- >>>>>>>>>>>> include/linux/swap.h | 2 ++ >>>>>>

Re: [PATCH 2/5] swap: fix do_swap_page() race with swapoff

2021-04-14 Thread Tim Chen
On 4/13/21 6:04 PM, Huang, Ying wrote: > Tim Chen writes: > >> On 4/12/21 6:27 PM, Huang, Ying wrote: >> >>> >>> This isn't the commit that introduces the race. You can use `git blame` >>> find out the correct commit. For this it's comm

Re: [PATCH 1/5] mm/swapfile: add percpu_ref support for swap

2021-04-14 Thread Dennis Zhou
>>>>>> Signed-off-by: Miaohe Lin > >> >> >>>>>> --- > >> >> >>>>>> include/linux/swap.h | 2 ++ > >> >> >>>>>> mm/swapfile.c| 25 ++--- > >>

Re: [PATCH 1/5] mm/swapfile: add percpu_ref support for swap

2021-04-13 Thread Huang, Ying
;>> patch adds the percpu_ref support for later fixup. >> >> >>>>>> >> >> >>>>>> Signed-off-by: Miaohe Lin >> >> >>>>>> --- >> >> >>>>>> include/linux/swap.h | 2 ++ >&

Re: [PATCH 1/5] mm/swapfile: add percpu_ref support for swap

2021-04-13 Thread Dennis Zhou
> > >> >>>>>> Signed-off-by: Miaohe Lin > >> >>>>>> --- > >> >>>>>> include/linux/swap.h | 2 ++ > >> >>>>>> mm/swapfile.c| 25 ++--- > >> >

Re: [PATCH 1/5] mm/swapfile: add percpu_ref support for swap

2021-04-13 Thread Huang, Ying
| 2 ++ >> >>>>>> mm/swapfile.c| 25 ++--- >> >>>>>> 2 files changed, 24 insertions(+), 3 deletions(-) >> >>>>>> >> >>>>>> diff --git a/include/linux/swap.h b

Re: [PATCH 1/5] mm/swapfile: add percpu_ref support for swap

2021-04-13 Thread Dennis Zhou
>>>>>> 2 files changed, 24 insertions(+), 3 deletions(-) > >>>>>> > >>>>>> diff --git a/include/linux/swap.h b/include/linux/swap.h > >>>>>> index 144727041e78..849ba5265c11 100644 > >>>>>> --- a/include/

Re: [PATCH 2/5] swap: fix do_swap_page() race with swapoff

2021-04-13 Thread Miaohe Lin
On 2021/4/14 11:07, Huang, Ying wrote: > Miaohe Lin writes: > >> On 2021/4/13 9:27, Huang, Ying wrote: >>> Miaohe Lin writes: >>> >>>> When I was investigating the swap code, I found the below possible race >>>> window: >

Re: [PATCH 2/5] swap: fix do_swap_page() race with swapoff

2021-04-13 Thread Huang, Ying
Miaohe Lin writes: > On 2021/4/13 9:27, Huang, Ying wrote: >> Miaohe Lin writes: >> >>> When I was investigating the swap code, I found the below possible race >>> window: >>> >>>

Re: [PATCH 2/5] swap: fix do_swap_page() race with swapoff

2021-04-13 Thread Miaohe Lin
On 2021/4/13 9:27, Huang, Ying wrote: > Miaohe Lin writes: > >> When I was investigating the swap code, I found the below possible race >> window: >> >> CPU 1CPU 2 >> ---

Re: [PATCH 2/5] swap: fix do_swap_page() race with swapoff

2021-04-13 Thread Miaohe Lin
On 2021/4/14 9:04, Huang, Ying wrote: > Tim Chen writes: > >> On 4/12/21 6:27 PM, Huang, Ying wrote: >> >>> >>> This isn't the commit that introduces the race. You can use `git blame` >>> find out the correct commit. For this it's commit 0bcac06f

Re: [PATCH 1/5] mm/swapfile: add percpu_ref support for swap

2021-04-13 Thread Huang, Ying
include/linux/swap.h | 2 ++ >>>>>> mm/swapfile.c| 25 ++--- >>>>>> 2 files changed, 24 insertions(+), 3 deletions(-) >>>>>> >>>>>> diff --git a/include/linux/swap.h b/include/linux/swap.h >&

Re: [PATCH 1/5] mm/swapfile: add percpu_ref support for swap

2021-04-13 Thread Miaohe Lin
+++--- >>>>> 2 files changed, 24 insertions(+), 3 deletions(-) >>>>> >>>>> diff --git a/include/linux/swap.h b/include/linux/swap.h >>>>> index 144727041e78..849ba5265c11 100644 >>>>> --- a/include/linux/swap.h &g

Re: [PATCH 1/5] mm/swapfile: add percpu_ref support for swap

2021-04-13 Thread Huang, Ying
>>> >>>> diff --git a/include/linux/swap.h b/include/linux/swap.h >>>> index 144727041e78..849ba5265c11 100644 >>>> --- a/include/linux/swap.h >>>> +++ b/include/linux/swap.h >>>> @@ -240,6 +240,7 @@ struct swap_cluster_list { >

Re: [PATCH 2/5] swap: fix do_swap_page() race with swapoff

2021-04-13 Thread Huang, Ying
Tim Chen writes: > On 4/12/21 6:27 PM, Huang, Ying wrote: > >> >> This isn't the commit that introduces the race. You can use `git blame` >> find out the correct commit. For this it's commit 0bcac06f27d7 "mm, >> swap: skip swapcache for swapin of synchr

[PATCH net-next v2 3/3] net: phy: marvell-88x2222: swap 1G/10G modes on autoneg

2021-04-13 Thread Ivan Bornyakov
Setting 10G without autonegotiation is invalid according to phy_ethtool_ksettings_set(). Thus, we need to set it during autonegotiation. If 1G autonegotiation can't complete for quite a time, but there is signal in line, switch line interface type to 10GBase-R, if supported, in hope for link to

Re: [PATCH 2/5] swap: fix do_swap_page() race with swapoff

2021-04-13 Thread Tim Chen
On 4/12/21 6:27 PM, Huang, Ying wrote: > > This isn't the commit that introduces the race. You can use `git blame` > find out the correct commit. For this it's commit 0bcac06f27d7 "mm, > swap: skip swapcache for swapin of synchronous device". > > And I suggest

Re: [PATCH 1/5] mm/swapfile: add percpu_ref support for swap

2021-04-13 Thread Miaohe Lin
linux/swap.h >>> index 144727041e78..849ba5265c11 100644 >>> --- a/include/linux/swap.h >>> +++ b/include/linux/swap.h >>> @@ -240,6 +240,7 @@ struct swap_cluster_list { >>> * The in-memory structure used to track swap areas. >>> */ >>> str

Re: [PATCH 2/5] swap: fix do_swap_page() race with swapoff

2021-04-12 Thread Huang, Ying
Miaohe Lin writes: > When I was investigating the swap code, I found the below possible race > window: > > CPU 1 CPU 2 > - - > do_swap_page > synchronous swap_readpage

[PATCH net-next 2/2] net: phy: marvell-88x2222: swap 1G/10G modes on autoneg

2021-04-12 Thread Ivan Bornyakov
Setting 10G without autonegotiation is invalid according to phy_ethtool_ksettings_set(). Thus, if autonegotiation can't complete for quite a time, but there is signal in line, switch line interface type to 10GBase-R, if supported, in hope for link to be established. And vice versa. Signed-off-by:

[PATCH v1 2/3] perf session: Add swap operation for event TIME_CONV

2021-04-12 Thread Leo Yan
Since commit d110162cafc8 ("perf tsc: Support cap_user_time_short for event TIME_CONV"), the event PERF_RECORD_TIME_CONV has extended the data structure for clock parameters. To be backwards-compatible, this patch adds a dedicated swap operation for the event PERF_RECORD_TIME_C

Re: [PATCH 1/5] mm/swapfile: add percpu_ref support for swap

2021-04-12 Thread Huang, Ying
b/include/linux/swap.h >> @@ -240,6 +240,7 @@ struct swap_cluster_list { >> * The in-memory structure used to track swap areas. >> */ >> struct swap_info_struct { >> +struct percpu_ref users;/* serialization against concurrent >> swapoff

Re: [PATCH 1/5] mm/swapfile: add percpu_ref support for swap

2021-04-12 Thread Miaohe Lin
>> +++ b/include/linux/swap.h >> @@ -240,6 +240,7 @@ struct swap_cluster_list { >> * The in-memory structure used to track swap areas. >> */ >> struct swap_info_struct { >> +struct percpu_ref users;/* serialization against concurrent >> swapoff

Re: [PATCH 1/5] mm/swapfile: add percpu_ref support for swap

2021-04-11 Thread Huang, Ying
gt; 2 files changed, 24 insertions(+), 3 deletions(-) > > diff --git a/include/linux/swap.h b/include/linux/swap.h > index 144727041e78..849ba5265c11 100644 > --- a/include/linux/swap.h > +++ b/include/linux/swap.h > @@ -240,6 +240,7 @@ struct swap_cluster_list { > * The

Re: [PATCH 2/5] swap: fix do_swap_page() race with swapoff

2021-04-11 Thread Miaohe Lin
On 2021/4/12 9:44, Huang, Ying wrote: > Miaohe Lin writes: > >> On 2021/4/10 1:17, Tim Chen wrote: >>> >>> >>> On 4/9/21 1:42 AM, Miaohe Lin wrote: >>>> On 2021/4/9 5:34, Tim Chen wrote: >>>>> >>>>> >>>>

Re: [PATCH 2/5] swap: fix do_swap_page() race with swapoff

2021-04-11 Thread Huang, Ying
Miaohe Lin writes: > On 2021/4/10 1:17, Tim Chen wrote: >> >> >> On 4/9/21 1:42 AM, Miaohe Lin wrote: >>> On 2021/4/9 5:34, Tim Chen wrote: >>>> >>>> >>>> On 4/8/21 6:08 AM, Miaohe Lin wrote: >>>>> Whe

Re: [PATCH 2/5] swap: fix do_swap_page() race with swapoff

2021-04-09 Thread Miaohe Lin
On 2021/4/10 1:17, Tim Chen wrote: > > > On 4/9/21 1:42 AM, Miaohe Lin wrote: >> On 2021/4/9 5:34, Tim Chen wrote: >>> >>> >>> On 4/8/21 6:08 AM, Miaohe Lin wrote: >>>> When I was investigating the swap code, I foun

Re: [PATCH 2/5] swap: fix do_swap_page() race with swapoff

2021-04-09 Thread Tim Chen
On 4/9/21 1:42 AM, Miaohe Lin wrote: > On 2021/4/9 5:34, Tim Chen wrote: >> >> >> On 4/8/21 6:08 AM, Miaohe Lin wrote: >>> When I was investigating the swap code, I found the below possible race >>> window: >>> >&

[PATCH net-next 2/3] net: ethernet: add property "nvmem_macaddr_swap" to swap macaddr bytes order

2021-04-09 Thread Joakim Zhang
() nvmem_get_mac_address() i.MX6x/7D/8MQ/8MM platforms ethernet MAC address read from nvmem ocotp eFuses, but it requires to swap the six bytes order. The patch add optional property "nvmem_macaddr_swap" to swap macaddr bytes order. Signed-off-by: Fugang Duan Signed-off-by: Joakim Zhang

Re: [PATCH 2/5] swap: fix do_swap_page() race with swapoff

2021-04-09 Thread Miaohe Lin
On 2021/4/9 5:34, Tim Chen wrote: > > > On 4/8/21 6:08 AM, Miaohe Lin wrote: >> When I was investigating the swap code, I found the below possible race >> window: >> >> CPU 1CPU 2 >> -

[PATCH net-next 2/3] net: ethernet: add property "nvmem_macaddr_swap" to swap macaddr bytes order

2021-04-09 Thread Joakim Zhang
() nvmem_get_mac_address() i.MX6x/7D/8MQ/8MM platforms ethernet MAC address read from nvmem ocotp eFuses, but it requires to swap the six bytes order. The patch add optional property "nvmem_macaddr_swap" to swap macaddr bytes order. Signed-off-by: Fugang Duan Signed-off-by: Joakim Zhang

Re: [PATCH 0/5] close various race windows for swap

2021-04-09 Thread Miaohe Lin
On 2021/4/8 22:55, riteshh wrote: > On 21/04/08 09:08AM, Miaohe Lin wrote: >> Hi all, >> When I was investigating the swap code, I found some possible race >> windows. This series aims to fix all these races. But using current >> get/put_swap_device() to guard

Re: [PATCH 2/5] swap: fix do_swap_page() race with swapoff

2021-04-08 Thread Tim Chen
On 4/8/21 6:08 AM, Miaohe Lin wrote: > When I was investigating the swap code, I found the below possible race > window: > > CPU 1 CPU 2 > - - > do_swap_page > synchronous swap_readpage

Re: [PATCH 0/5] close various race windows for swap

2021-04-08 Thread riteshh
On 21/04/08 09:08AM, Miaohe Lin wrote: > Hi all, > When I was investigating the swap code, I found some possible race > windows. This series aims to fix all these races. But using current > get/put_swap_device() to guard against concurrent swapoff for > swap_readpage() looks t

[PATCH 2/5] swap: fix do_swap_page() race with swapoff

2021-04-08 Thread Miaohe Lin
When I was investigating the swap code, I found the below possible race window: CPU 1 CPU 2 - - do_swap_page synchronous swap_readpage alloc_page_vma swapoff

[PATCH 1/5] mm/swapfile: add percpu_ref support for swap

2021-04-08 Thread Miaohe Lin
--git a/include/linux/swap.h b/include/linux/swap.h index 144727041e78..849ba5265c11 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h @@ -240,6 +240,7 @@ struct swap_cluster_list { * The in-memory structure used to track swap areas. */ struct swap_info_struct { + struct

[PATCH 0/5] close various race windows for swap

2021-04-08 Thread Miaohe Lin
Hi all, When I was investigating the swap code, I found some possible race windows. This series aims to fix all these races. But using current get/put_swap_device() to guard against concurrent swapoff for swap_readpage() looks terrible because swap_readpage() may take really long time

[PATCH v8 2/8] mm/swapops: Rework swap entry manipulation code

2021-04-07 Thread Alistair Popple
Both migration and device private pages use special swap entries that are manipluated by a range of inline functions. The arguments to these are somewhat inconsitent so rework them to remove flag type arguments and to make the arguments similar for both read and write entry creation. Signed-off

[PATCH v8 1/8] mm: Remove special swap entry functions

2021-04-07 Thread Alistair Popple
Remove multiple similar inline functions for dealing with different types of special swap entries. Both migration and device private swap entries use the swap offset to store a pfn. Instead of multiple inline functions to obtain a struct page for each swap entry type use a common function

Re: [RFC PATCH] mm/swap: fix system stuck due to infinite loop

2021-04-05 Thread Alexey Avramov
> In the case of high system memory and load pressure, we ran ltp test > and found that the system was stuck, the direct memory reclaim was > all stuck in io_schedule > For the first time involving the swap part, there is no good way to fix > the problem The solution is protecting

[PATCH 8/8] drm/msm: Support evicting GEM objects to swap

2021-04-05 Thread Rob Clark
From: Rob Clark Now that tracking is wired up for potentially evictable GEM objects, wire up shrinker and the remaining GEM bits for unpinning backing pages of inactive objects. Signed-off-by: Rob Clark --- drivers/gpu/drm/msm/msm_gem.c | 23

Re: [PATCH v3] coccinelle: misc: add swap script

2021-04-04 Thread Julia Lawall
On Sun, 28 Mar 2021, Denis Efremov wrote: > Ping? Applied. Thanks. > > On 3/5/21 1:09 PM, Denis Efremov wrote: > > Check for opencoded swap() implementation. > > > > Signed-off-by: Denis Efremov > > --- > > Changes in v2: > > - additiona

Re: [RFC PATCH] mm/swap: fix system stuck due to infinite loop

2021-04-02 Thread Andrew Morton
system hang. > > For the first time involving the swap part, there is no good way to fix > the problem from the fundamental problem. In order to solve the > engineering situation, we chose to make swap_cluster_readahead aware of > the memory pressure situation as soon as possible,

Re: [PATCH 08/10] mm/vmscan: Consider anonymous pages without swap

2021-04-01 Thread Wei Xu
On Thu, Apr 1, 2021 at 11:35 AM Dave Hansen wrote: > > > From: Keith Busch > > Reclaim anonymous pages if a migration path is available now that > demotion provides a non-swap recourse for reclaiming anon pages. > > Note that this check is subtly different from the > a

[PATCH 08/10] mm/vmscan: Consider anonymous pages without swap

2021-04-01 Thread Dave Hansen
From: Keith Busch Reclaim anonymous pages if a migration path is available now that demotion provides a non-swap recourse for reclaiming anon pages. Note that this check is subtly different from the anon_should_be_aged() checks. This mechanism checks whether a specific page in a specific

Re: [PATCH v7 1/8] mm: Remove special swap entry functions

2021-03-30 Thread Jason Gunthorpe
On Fri, Mar 26, 2021 at 11:07:58AM +1100, Alistair Popple wrote: > Remove multiple similar inline functions for dealing with different > types of special swap entries. > > Both migration and device private swap entries use the swap offset to > store a pfn. Instead of multiple i

[PATCH v8 1/2] dt-bindings: serial: Add rx-tx-swap to stm32-usart

2021-03-28 Thread Martin Devera
Add new rx-tx-swap property to allow for RX & TX pin swapping. Signed-off-by: Martin Devera Acked-by: Fabrice Gasnier Reviewed-by: Rob Herring --- v8: - rebase to the latest tty-next v7: - fix yaml linter warning v6: - add version changelog v5: - yaml fixes based on Rob Her

[PATCH v8 2/2] tty/serial: Add rx-tx-swap OF option to stm32-usart

2021-03-28 Thread Martin Devera
swap to stm32_usart_info (because F4 line doesn't support swapping) - move swap variable init from stm32_usart_of_get_port to stm32_usart_init_port because info struct is not initialized in stm32_usart_of_get_port yet - set USART_CR2_SWAP in stm32_usart_startup too v2: - change st,swap t

Re: [PATCH v3] coccinelle: misc: add swap script

2021-03-28 Thread Denis Efremov
Ping? On 3/5/21 1:09 PM, Denis Efremov wrote: Check for opencoded swap() implementation. Signed-off-by: Denis Efremov --- Changes in v2: - additional patch rule to drop excessive {} - fix indentation in patch mode by anchoring ; Changes in v3: - Rule added for simple (without var init

Re: [PATCH v7 2/2] tty/serial: Add rx-tx-swap OF option to stm32-usart

2021-03-26 Thread Greg Kroah-Hartman
On Fri, Mar 12, 2021 at 04:37:02PM +0100, Martin Devera wrote: > STM32 F7/H7 usarts supports RX & TX pin swapping. > Add option to turn it on. > Tested on STM32MP157. > > Signed-off-by: Martin Devera > Acked-by: Fabrice Gasnier This does not apply to my tty-next branch at all. Can you please

[PATCH v7 2/8] mm/swapops: Rework swap entry manipulation code

2021-03-25 Thread Alistair Popple
Both migration and device private pages use special swap entries that are manipluated by a range of inline functions. The arguments to these are somewhat inconsitent so rework them to remove flag type arguments and to make the arguments similar for both read and write entry creation. Signed-off

[PATCH v7 1/8] mm: Remove special swap entry functions

2021-03-25 Thread Alistair Popple
Remove multiple similar inline functions for dealing with different types of special swap entries. Both migration and device private swap entries use the swap offset to store a pfn. Instead of multiple inline functions to obtain a struct page for each swap entry type use a common function

Re: [PATCH v7 1/2] dt-bindings: serial: Add rx-tx-swap to stm32-usart

2021-03-23 Thread Rob Herring
On Fri, 12 Mar 2021 16:37:01 +0100, Martin Devera wrote: > Add new rx-tx-swap property to allow for RX & TX pin swapping. > > Signed-off-by: Martin Devera > Acked-by: Fabrice Gasnier > --- > v7: > - fix yaml linter warning > v6: > - add version changelog >

[PATCH 18/23] mm/hugetlb: Introduce huge version of special swap pte helpers

2021-03-22 Thread Peter Xu
This is to let hugetlbfs be prepared to also recognize swap special ptes just like uffd-wp special swap ptes. Signed-off-by: Peter Xu --- mm/hugetlb.c | 23 +-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/mm/hugetlb.c b/mm/hugetlb.c index fd3e87517e10

  1   2   3   4   5   6   7   8   9   10   >