Re: [PATCH v20 02/20] mm/memcg: bail early from swap accounting if memcg disabled

2020-10-29 Thread Alex Shi
在 2020/10/29 下午9:46, Johannes Weiner 写道: >> ? release_pages+0x1ae/0x410 >> shmem_alloc_and_acct_page+0x77/0x1c0 >> shmem_getpage_gfp+0x162/0x910 >> shmem_fault+0x74/0x210 >> ? filemap_map_pages+0x29c/0x410 >> __do_fault+0x37/0x190 >> handle_mm_fault+0x120a/0x1770 >>

Re: [RFC][PATCH 7/9] mm/vmscan: Consider anonymous pages without swap

2020-10-29 Thread Yang Shi
ct anon pages at all, so "total_swap_pages" is used instead of > > checking swappiness and available swap space. > > > > The changes may result in imbalanced anon lru. > > I might be missing something, so bear with me. > > It is true that since we are only reb

Re: [RFC][PATCH 7/9] mm/vmscan: Consider anonymous pages without swap

2020-10-29 Thread osalvador
t; checking swappiness and available swap space. > > The changes may result in imbalanced anon lru. I might be missing something, so bear with me. It is true that since we are only rebalancing the lists, we do not need to check for swap space yet, but here we are also adding a new end-point whe

Re: [RFC][PATCH 7/9] mm/vmscan: Consider anonymous pages without swap

2020-10-29 Thread Yang Shi
t all. They are used to rebalance the anon lru active/inactive ratio even if we did not try to evict anon pages at all, so "total_swap_pages" is used instead of checking swappiness and available swap space. The changes may result in imbalanced anon lru. > > Thanks for taking a look! >

Re: [RFC][PATCH 7/9] mm/vmscan: Consider anonymous pages without swap

2020-10-29 Thread Dave Hansen
On 10/29/20 1:14 AM, Oscar Salvador wrote: > With this patch, we will use always the atomic version > get_nr_swap_pages from now on. Is that ok? I guess so, but it might > warrant a mention in the changelog? I _think_ it's OK. But, you're right that it's a potential behavior change that's not

Re: [PATCH v20 02/20] mm/memcg: bail early from swap accounting if memcg disabled

2020-10-29 Thread Johannes Weiner
On Thu, Oct 29, 2020 at 06:44:47PM +0800, Alex Shi wrote: > If we disabled memcg by cgroup_disable=memory, page->memcg will be NULL > and so the charge is skipped and that will trigger a warning like below. > Let's return from the funcs earlier. > > anon

[PATCH v20 02/20] mm/memcg: bail early from swap accounting if memcg disabled

2020-10-29 Thread Alex Shi
If we disabled memcg by cgroup_disable=memory, page->memcg will be NULL and so the charge is skipped and that will trigger a warning like below. Let's return from the funcs earlier. anon flags:0x5005b48008000d(locked|uptodate|dirty|swapbacked) raw: 005005b48008000d dead0100

Re: [RFC][PATCH 7/9] mm/vmscan: Consider anonymous pages without swap

2020-10-29 Thread Oscar Salvador
On Wed, Oct 07, 2020 at 09:17:49AM -0700, Dave Hansen wrote: > > From: Keith Busch > > Age and reclaim anonymous pages if a migration path is available. The > node has other recourses for inactive anonymous pages beyond swap, > > #Signed-off-by: Keith Busch > Cc: Keith

[PATCH 4.19 064/264] spi: spi-s3c64xx: swap s3c64xx_spi_set_cs() and s3c64xx_enable_datapath()

2020-10-27 Thread Greg Kroah-Hartman
From: Łukasz Stelmach [ Upstream commit 581e2b41977dfc2d4c26c8e976f89c43bb92f9bf ] Fix issues with DMA transfers bigger than 512 bytes on Exynos3250. Without the patches such transfers fail to complete. This solution to the problem is found in the vendor kernel for ARTIK5 boards based on

[PATCH 5.8 147/633] spi: spi-s3c64xx: swap s3c64xx_spi_set_cs() and s3c64xx_enable_datapath()

2020-10-27 Thread Greg Kroah-Hartman
From: Łukasz Stelmach [ Upstream commit 581e2b41977dfc2d4c26c8e976f89c43bb92f9bf ] Fix issues with DMA transfers bigger than 512 bytes on Exynos3250. Without the patches such transfers fail to complete. This solution to the problem is found in the vendor kernel for ARTIK5 boards based on

[PATCH 5.9 621/757] ARM: dts: stm32: Swap PHY reset GPIO and TSC2004 IRQ on DHCOM SOM

2020-10-27 Thread Greg Kroah-Hartman
From: Marek Vasut [ Upstream commit 9ad98319e95263469d8ca2cb543c37c5a2f40980 ] On the production revision of the SoM, 587-200, the PHY reset GPIO and touchscreen IRQs are swapped to prevent collision between EXTi IRQs, reflect that in DT. Fixes: 34e0c7847dcf ("ARM: dts: stm32: Add DH

[PATCH 5.8 510/633] ARM: dts: stm32: Swap PHY reset GPIO and TSC2004 IRQ on DHCOM SOM

2020-10-27 Thread Greg Kroah-Hartman
From: Marek Vasut [ Upstream commit 9ad98319e95263469d8ca2cb543c37c5a2f40980 ] On the production revision of the SoM, 587-200, the PHY reset GPIO and touchscreen IRQs are swapped to prevent collision between EXTi IRQs, reflect that in DT. Fixes: 34e0c7847dcf ("ARM: dts: stm32: Add DH

[PATCH 5.9 175/757] spi: spi-s3c64xx: swap s3c64xx_spi_set_cs() and s3c64xx_enable_datapath()

2020-10-27 Thread Greg Kroah-Hartman
From: Łukasz Stelmach [ Upstream commit 581e2b41977dfc2d4c26c8e976f89c43bb92f9bf ] Fix issues with DMA transfers bigger than 512 bytes on Exynos3250. Without the patches such transfers fail to complete. This solution to the problem is found in the vendor kernel for ARTIK5 boards based on

[PATCH 5.4 100/408] spi: spi-s3c64xx: swap s3c64xx_spi_set_cs() and s3c64xx_enable_datapath()

2020-10-27 Thread Greg Kroah-Hartman
From: Łukasz Stelmach [ Upstream commit 581e2b41977dfc2d4c26c8e976f89c43bb92f9bf ] Fix issues with DMA transfers bigger than 512 bytes on Exynos3250. Without the patches such transfers fail to complete. This solution to the problem is found in the vendor kernel for ARTIK5 boards based on

Re: [PATCH] mm: swap: Use memset to fill the swap_map with SWAP_HAS_CACHE

2020-10-25 Thread linmiaohe
Andrew Morton wrote: > On Mon, 21 Sep 2020 08:22:24 -0400 Miaohe Lin wrote: > >> We could use helper memset to fill the swap_map with SWAP_HAS_CACHE >> instead of a direct loop here to simplify the code. Also we can remove >> the local variable i and map this way. >> *slot =

Re: [PATCH] mm/swap_state: Skip meaningless swap cache readahead when ra_info.win == 0

2020-10-25 Thread linmiaohe
Andrew Morton wrote: > On Fri, 9 Oct 2020 09:30:59 -0400 Miaohe Lin wrote: > >> swap_ra_info() may leave ra_info untouched in non_swap_entry() case as >> page table lock is not held. In this case, we have ra_info.nr_pte == 0 >> and it is meaningless to continue with sw

Re: [PATCH] mm: swap: Use memset to fill the swap_map with SWAP_HAS_CACHE

2020-10-25 Thread Andrew Morton
On Mon, 21 Sep 2020 08:22:24 -0400 Miaohe Lin wrote: > We could use helper memset to fill the swap_map with SWAP_HAS_CACHE instead > of a direct loop here to simplify the code. Also we can remove the local > variable i and map this way. > > ... > > --- a/mm/swapfile.c > +++ b/mm/swapfile.c > @@

Re: [PATCH] mm/swap_state: Skip meaningless swap cache readahead when ra_info.win == 0

2020-10-25 Thread Andrew Morton
On Fri, 9 Oct 2020 09:30:59 -0400 Miaohe Lin wrote: > swap_ra_info() may leave ra_info untouched in non_swap_entry() case as page > table lock is not held. In this case, we have ra_info.nr_pte == 0 and it is > meaningless to continue with swap cache readahead. Skip such ops by init >

Re: swap file broken with ext4 fast-commit

2020-10-24 Thread Andrea Righi
On Sat, Oct 24, 2020 at 03:13:37PM +0200, Andrea Righi wrote: > I'm getting the following error if I try to create and activate a swap > file defined on an ext4 filesystem: > > [ 34.406479] swapon: file is not committed > > The swap file is created in the root filesy

swap file broken with ext4 fast-commit

2020-10-24 Thread Andrea Righi
I'm getting the following error if I try to create and activate a swap file defined on an ext4 filesystem: [ 34.406479] swapon: file is not committed The swap file is created in the root filesystem (ext4 mounted with the following options): $ grep " / " /proc/mounts /dev/vda1

Announce loop-AES-v3.7s file/swap crypto package

2020-10-17 Thread Jari Ruusu
loop-AES changes since previous release: - Worked around kernel interface changes on 5.9 kernels - Partial re-write of ioctl handling to get rid of set_fs() which is expected to be removed from mainline kernels in near future. bzip2 compressed tarball is here:

Re: [PATCH 0/2] mm,swap: skip swap readahead for instant IO (like zswap)

2020-10-09 Thread Rik van Riel
On Mon, 2020-10-05 at 13:32 -0400, Rik van Riel wrote: > On Tue, 2020-09-22 at 10:12 -0700, Andrew Morton wrote: > > On Mon, 21 Sep 2020 22:01:46 -0400 Rik van Riel > > wrote: > > Any quantitative testing results? > > I have test results with a real workload now. > > Without this patch,

[PATCH] mm/swap_state: Skip meaningless swap cache readahead when ra_info.win == 0

2020-10-09 Thread Miaohe Lin
swap_ra_info() may leave ra_info untouched in non_swap_entry() case as page table lock is not held. In this case, we have ra_info.nr_pte == 0 and it is meaningless to continue with swap cache readahead. Skip such ops by init ra_info.win = 1. Signed-off-by: Miaohe Lin --- mm/swap_state.c | 2

[PATCH v10 06/15] usb: typec: tcpm: Add support for Sink Fast Role SWAP(FRS)

2020-10-08 Thread Badhri Jagan Sridharan
PD 3.0 spec defines a new mechanism for power role swap called Fast role swap. This change enables TCPM to support FRS when acting as sink. Once the explicit contract is negotiated, sink port is expected to query the source port for sink caps to determine whether the source is FRS capable. Bits

[RFC][PATCH 7/9] mm/vmscan: Consider anonymous pages without swap

2020-10-07 Thread Dave Hansen
From: Keith Busch Age and reclaim anonymous pages if a migration path is available. The node has other recourses for inactive anonymous pages beyond swap, #Signed-off-by: Keith Busch Cc: Keith Busch [vishal: fixup the migration->demotion rename] Signed-off-by: Vishal Verma Signed-

Re: [PATCH] mm: swap: Use memset to fill the swap_map with SWAP_HAS_CACHE

2020-10-06 Thread linmiaohe
Friendly ping. > We could use helper memset to fill the swap_map with SWAP_HAS_CACHE instead > of a direct loop here to simplify the code. Also we can remove the local > variable i and map this way. > > Signed-off-by: Miaohe Lin > --- > mm/swapfile.c | 7 ++- > 1 file changed, 2

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

2020-10-06 Thread Dave Hansen
From: Keith Busch Age and reclaim anonymous pages if a migration path is available. The node has other recourses for inactive anonymous pages beyond swap, #Signed-off-by: Keith Busch Cc: Keith Busch [vishal: fixup the migration->demotion rename] Signed-off-by: Vishal Verma Signed-

Re: [PATCH 0/2] mm,swap: skip swap readahead for instant IO (like zswap)

2020-10-05 Thread Rik van Riel
On Tue, 2020-09-22 at 10:12 -0700, Andrew Morton wrote: > On Mon, 21 Sep 2020 22:01:46 -0400 Rik van Riel > wrote: > > > Both with frontswap/zswap, and with some extremely fast IO devices, > > swap IO will be done before the "asynchronous" swap_r

Re: [PATCH 02/25] ASoC: sun8i-codec: Swap module clock/reset dependencies

2020-10-05 Thread Maxime Ripard
On Wed, Sep 30, 2020 at 09:11:25PM -0500, Samuel Holland wrote: > This matches the module power-up/down sequence from the vendor's driver. > > While updating these widgets/routes, reorder them to match the register > and bit layout of the hardware. This puts them in the same place in the > widget

[PATCH v3 1/9] spi: spi-s3c64xx: swap s3c64xx_spi_set_cs() and s3c64xx_enable_datapath()

2020-10-02 Thread Łukasz Stelmach
Fix issues with DMA transfers bigger than 512 bytes on Exynos3250. Without the patches such transfers fail to complete. This solution to the problem is found in the vendor kernel for ARTIK5 boards based on Exynos3250. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Łukasz Stelmach ---

[PATCH v2 RESEND 1/9] spi: spi-s3c64xx: swap s3c64xx_spi_set_cs() and s3c64xx_enable_datapath()

2020-10-01 Thread Łukasz Stelmach
Fix issues with DMA transfers bigger than 512 bytes on Exynos3250. Without the patches such transfers fail to complete. This solution to the problem is found in the vendor kernel for ARTIK5 boards based on Exynos3250. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Łukasz Stelmach ---

[PATCH 02/25] ASoC: sun8i-codec: Swap module clock/reset dependencies

2020-09-30 Thread Samuel Holland
This matches the module power-up/down sequence from the vendor's driver. While updating these widgets/routes, reorder them to match the register and bit layout of the hardware. This puts them in the same place in the widget and route arrays (previously they were at opposite ends), and it makes it

[PATCH 4.14 162/166] mm, THP, swap: fix allocating cluster for swapfile by mistake

2020-09-29 Thread Greg Kroah-Hartman
From: Gao Xiang commit 41663430588c737dd735bad5a0d1ba325dcabd59 upstream. SWP_FS is used to make swap_{read,write}page() go through the filesystem, and it's only used for swap files over NFS. So, !SWP_FS means non NFS for now, it could be either file backed or device backed. Something similar

[PATCH 5.4 158/388] perf cs-etm: Swap packets for instruction samples

2020-09-29 Thread Greg Kroah-Hartman
, so the new coming packets cannot be properly handled for only synthesizing instruction samples. To fix this issue, this patch refactors the code with a new function cs_etm__packet_swap() which is used to swap packets and adds the condition for instruction samples. Signed-off-by: Leo Yan

[PATCH 5.4 380/388] mm, THP, swap: fix allocating cluster for swapfile by mistake

2020-09-29 Thread Greg Kroah-Hartman
From: Gao Xiang commit 41663430588c737dd735bad5a0d1ba325dcabd59 upstream. SWP_FS is used to make swap_{read,write}page() go through the filesystem, and it's only used for swap files over NFS. So, !SWP_FS means non NFS for now, it could be either file backed or device backed. Something similar

[PATCH 5.8 91/99] mm, THP, swap: fix allocating cluster for swapfile by mistake

2020-09-29 Thread Greg Kroah-Hartman
From: Gao Xiang commit 41663430588c737dd735bad5a0d1ba325dcabd59 upstream. SWP_FS is used to make swap_{read,write}page() go through the filesystem, and it's only used for swap files over NFS. So, !SWP_FS means non NFS for now, it could be either file backed or device backed. Something similar

[PATCH 4.19 239/245] mm, THP, swap: fix allocating cluster for swapfile by mistake

2020-09-29 Thread Greg Kroah-Hartman
From: Gao Xiang commit 41663430588c737dd735bad5a0d1ba325dcabd59 upstream. SWP_FS is used to make swap_{read,write}page() go through the filesystem, and it's only used for swap files over NFS. So, !SWP_FS means non NFS for now, it could be either file backed or device backed. Something similar

[PATCH v9 06/15] usb: typec: tcpm: Add support for Sink Fast Role SWAP(FRS)

2020-09-28 Thread Badhri Jagan Sridharan
PD 3.0 spec defines a new mechanism for power role swap called Fast role swap. This change enables TCPM to support FRS when acting as sink. Once the explicit contract is negotiated, sink port is expected to query the source port for sink caps to determine whether the source is FRS capable. Bits

[PATCH v19 02/20] mm/memcg: bail early from swap accounting if memcg disabled

2020-09-23 Thread Alex Shi
If we disabled memcg by cgroup_disable=memory, page->memcg will be NULL and so the charge is skipped and that will trigger a warning like below. Let's return from the funcs earlier. anon flags:0x5005b48008000d(locked|uptodate|dirty|swapbacked) raw: 005005b48008000d dead0100

[PATCH v2 11/15] KVM: VMX: Add vmx_setup_uret_msr() to handle lookup and swap

2020-09-23 Thread Sean Christopherson
100644 --- a/arch/x86/kvm/vmx/vmx.c +++ b/arch/x86/kvm/vmx/vmx.c @@ -1685,12 +1685,15 @@ static void vmx_queue_exception(struct kvm_vcpu *vcpu) vmx_clear_hlt(vcpu); } -/* - * Swap MSR entry in host/guest MSR entry array. - */ -static void move_msr_up(struct vcpu_vmx *vmx, int from, int

Re: [PATCH 2/2] mm,swap: skip swap readahead if page was obtained instantaneously

2020-09-23 Thread Christoph Hellwig
On Mon, Sep 21, 2020 at 10:01:48PM -0400, Rik van Riel wrote: > + struct page *page; > unsigned long entry_offset = swp_offset(entry); > unsigned long offset = entry_offset; > unsigned long start_offset, end_offset; > @@ -668,11 +669,18 @@ struct page

Re: [PATCH 1/2] mm,swap: extract swap single page readahead into its own function

2020-09-23 Thread Christoph Hellwig
On Mon, Sep 21, 2020 at 10:01:47PM -0400, Rik van Riel wrote: > +static struct page *swap_cluster_read_one(swp_entry_t entry, > + unsigned long offset, gfp_t gfp_mask, > + struct vm_area_struct *vma, unsigned long addr, bool readahead) > +{ > + bool page_allocated; > +

Re: [PATCH 0/2] mm,swap: skip swap readahead for instant IO (like zswap)

2020-09-22 Thread Andrew Morton
On Mon, 21 Sep 2020 22:01:46 -0400 Rik van Riel wrote: > Both with frontswap/zswap, and with some extremely fast IO devices, > swap IO will be done before the "asynchronous" swap_readpage() call > has returned. > > In that case, doing swap readahead only wastes me

Re: [PATCH 2/2] mm,swap: skip swap readahead if page was obtained instantaneously

2020-09-22 Thread Rik van Riel
On Tue, 2020-09-22 at 11:13 +0800, huang ying wrote: > On Tue, Sep 22, 2020 at 10:02 AM Rik van Riel > wrote: > > Check whether a swap page was obtained instantaneously, for example > > because it is in zswap, or on a very fast IO device which uses busy > > waiting, a

Re: [PATCH 2/2] mm,swap: skip swap readahead if page was obtained instantaneously

2020-09-21 Thread huang ying
On Tue, Sep 22, 2020 at 10:02 AM Rik van Riel wrote: > > Check whether a swap page was obtained instantaneously, for example > because it is in zswap, or on a very fast IO device which uses busy > waiting, and we did not wait on IO to swap in this page. > If no IO was needed to ge

[PATCH 2/2] mm,swap: skip swap readahead if page was obtained instantaneously

2020-09-21 Thread Rik van Riel
Check whether a swap page was obtained instantaneously, for example because it is in zswap, or on a very fast IO device which uses busy waiting, and we did not wait on IO to swap in this page. If no IO was needed to get the swap page we want, kicking off readahead on surrounding swap pages

[PATCH 1/2] mm,swap: extract swap single page readahead into its own function

2020-09-21 Thread Rik van Riel
Split swap single page readahead into its own function, to make the next patch easier to read. No functional changes. Signed-off-by: Rik van Riel --- mm/swap_state.c | 40 +--- 1 file changed, 25 insertions(+), 15 deletions(-) diff --git a/mm/swap_state.c b

[PATCH 0/2] mm,swap: skip swap readahead for instant IO (like zswap)

2020-09-21 Thread Rik van Riel
Both with frontswap/zswap, and with some extremely fast IO devices, swap IO will be done before the "asynchronous" swap_readpage() call has returned. In that case, doing swap readahead only wastes memory, increases latency, and increases the chances of needing to evict something more u

[PATCH v8 06/11] usb: typec: tcpm: Add support for Sink Fast Role SWAP(FRS)

2020-09-21 Thread Badhri Jagan Sridharan
PD 3.0 spec defines a new mechanism for power role swap called Fast role swap. This change enables TCPM to support FRS when acting as sink. Once the explicit contract is negotiated, sink port is expected to query the source port for sink caps to determine whether the source is FRS capable. Bits

[PATCH] mm: swap: Use memset to fill the swap_map with SWAP_HAS_CACHE

2020-09-21 Thread Miaohe Lin
We could use helper memset to fill the swap_map with SWAP_HAS_CACHE instead of a direct loop here to simplify the code. Also we can remove the local variable i and map this way. Signed-off-by: Miaohe Lin --- mm/swapfile.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git

Re: [PATCH v7 06/11] usb: typec: tcpm: Add support for Sink Fast Role SWAP(FRS)

2020-09-18 Thread Heikki Krogerus
On Thu, Sep 17, 2020 at 03:18:51AM -0700, Badhri Jagan Sridharan wrote: > PD 3.0 spec defines a new mechanism for power role swap called > Fast role swap. This change enables TCPM to support FRS when > acting as sink. > > Once the explicit contract is negotiated, sink port is >

[PATCH AUTOSEL 5.4 164/330] perf cs-etm: Swap packets for instruction samples

2020-09-17 Thread Sasha Levin
, so the new coming packets cannot be properly handled for only synthesizing instruction samples. To fix this issue, this patch refactors the code with a new function cs_etm__packet_swap() which is used to swap packets and adds the condition for instruction samples. Signed-off-by: Leo Yan

Re: [PATCH v6 09/14] usb: typec: tcpm: Add support for Sink Fast Role SWAP(FRS)

2020-09-17 Thread Badhri Jagan Sridharan
On Tue, Sep 15, 2020 at 6:20 AM Heikki Krogerus wrote: > > On Mon, Aug 31, 2020 at 07:59:22PM -0700, Badhri Jagan Sridharan wrote: > > PD 3.0 spec defines a new mechanism for power role swap called > > Fast role swap. This change enables TCPM to support FRS when > > acti

[PATCH v7 06/11] usb: typec: tcpm: Add support for Sink Fast Role SWAP(FRS)

2020-09-17 Thread Badhri Jagan Sridharan
PD 3.0 spec defines a new mechanism for power role swap called Fast role swap. This change enables TCPM to support FRS when acting as sink. Once the explicit contract is negotiated, sink port is expected to query the source port for sink caps to determine whether the source is FRS capable. Bits

Re: rtw88: rtw8822c: eliminate code duplication, use native swap() function

2020-09-16 Thread Kalle Valo
Ivan Safonov wrote: > swap_u32() duplicate native swap(), so replace swap_u32() with swap(). > > Signed-off-by: Ivan Safonov Patch applied to wireless-drivers-next.git, thanks. d10f6af58ef4 rtw88: rtw8822c: eliminate code duplication, use native swap() function

Re: [PATCH v6 09/14] usb: typec: tcpm: Add support for Sink Fast Role SWAP(FRS)

2020-09-15 Thread Heikki Krogerus
On Mon, Aug 31, 2020 at 07:59:22PM -0700, Badhri Jagan Sridharan wrote: > PD 3.0 spec defines a new mechanism for power role swap called > Fast role swap. This change enables TCPM to support FRS when > acting as sink. > > Once the explicit contract is negotiated, sink port is >

Re: [PATCH v2 3/3] mm/memcg: Unify swap and memsw page counters

2020-09-14 Thread Shakeel Butt
On Sun, Sep 13, 2020 at 7:45 PM Waiman Long wrote: > > The swap page counter is v2 only while memsw is v1 only. As v1 and v2 > controllers cannot be active at the same time, there is no point to keep > both swap and memsw page counters in mem_cgroup. The previous patch has > made

Re: [PATCH v2 3/3] mm/memcg: Unify swap and memsw page counters

2020-09-14 Thread Michal Hocko
On Sun 13-09-20 22:44:52, Waiman Long wrote: > The swap page counter is v2 only while memsw is v1 only. As v1 and v2 > controllers cannot be active at the same time, there is no point to keep > both swap and memsw page counters in mem_cgroup. The previous patch has > made sure tha

[PATCH v2 3/3] mm/memcg: Unify swap and memsw page counters

2020-09-13 Thread Waiman Long
The swap page counter is v2 only while memsw is v1 only. As v1 and v2 controllers cannot be active at the same time, there is no point to keep both swap and memsw page counters in mem_cgroup. The previous patch has made sure that memsw page counter is updated and accessed only when in v1 code

[PATCH] wireless: rtw88: rtw8822c: eliminate code duplication, use native swap() function

2020-09-13 Thread Ivan Safonov
swap_u32() duplicate native swap(), so replace swap_u32() with swap(). Signed-off-by: Ivan Safonov --- drivers/net/wireless/realtek/rtw88/rtw8822c.c | 15 +++ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/drivers/net/wireless/realtek/rtw88/rtw8822c.c b/drivers/net

[tip: locking/core] mm/swap: Do not abuse the seqcount_t latching API

2020-09-10 Thread tip-bot2 for Ahmed S. Darwish
Committer: Peter Zijlstra CommitterDate: Thu, 10 Sep 2020 11:19:28 +02:00 mm/swap: Do not abuse the seqcount_t latching API Commit eef1a429f234 ("mm/swap.c: piggyback lru_add_drain_all() calls") implemented an optimization mechanism to exit the to-be-started LRU drain opera

[PATCH] mm: swap: Fix confusing comment in release_pages()

2020-09-05 Thread Miaohe Lin
Since commit 07d802699528 ("mm: devmap: refactor 1-based refcounting for ZONE_DEVICE pages"), we have renamed the func put_devmap_managed_page() to page_is_devmap_managed(). Signed-off-by: Miaohe Lin --- mm/swap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/swap.c

Re: [PATCH] RFC: sun4i/drm: Swap back U and V channels for DRM_FORMAT_YVU4xx

2020-09-01 Thread Jernej Škrabec
Dne torek, 01. september 2020 ob 23:29:29 CEST je Ondřej Jirman napisal(a): > On Tue, Sep 01, 2020 at 11:30:47PM +0300, Roman Stratiienko wrote: > > Fixes: e1ef9006663b ("drm/sun4i: Wire in DE2 YUV support") > > Signed-off-by: Roman Stratiienko > > > > --- > > CC: meg...@megous.com > > CC:

Re: [PATCH] RFC: sun4i/drm: Swap back U and V channels for DRM_FORMAT_YVU4xx

2020-09-01 Thread Ondřej Jirman
On Tue, Sep 01, 2020 at 11:30:47PM +0300, Roman Stratiienko wrote: > Fixes: e1ef9006663b ("drm/sun4i: Wire in DE2 YUV support") > Signed-off-by: Roman Stratiienko > > --- > CC: meg...@megous.com > CC: jernej.skra...@gmail.com > CC: linux-su...@googlegroups.com > CC:

[PATCH] RFC: sun4i/drm: Swap back U and V channels for DRM_FORMAT_YVU4xx

2020-09-01 Thread Roman Stratiienko
Fixes: e1ef9006663b ("drm/sun4i: Wire in DE2 YUV support") Signed-off-by: Roman Stratiienko --- CC: meg...@megous.com CC: jernej.skra...@gmail.com CC: linux-su...@googlegroups.com CC: dri-de...@lists.freedesktop.org CC: linux-arm-ker...@lists.infradead.org CC: linux-kernel@vger.kernel.org Hi,

[PATCH 5.8 175/255] btrfs: detect nocow for swap after snapshot delete

2020-09-01 Thread Greg Kroah-Hartman
leads to a bug where you are unable to use a swapfile if you ever snapshotted the subvolume it's in. Make the check slower and more strict for the swapon case, without modifying the general cow checks as a compromise. Turning swap on does not seem to be a particularly performance sensitive operation

[PATCH 5.4 156/214] btrfs: detect nocow for swap after snapshot delete

2020-09-01 Thread Greg Kroah-Hartman
leads to a bug where you are unable to use a swapfile if you ever snapshotted the subvolume it's in. Make the check slower and more strict for the swapon case, without modifying the general cow checks as a compromise. Turning swap on does not seem to be a particularly performance sensitive operation

[PATCH v6 09/14] usb: typec: tcpm: Add support for Sink Fast Role SWAP(FRS)

2020-08-31 Thread Badhri Jagan Sridharan
PD 3.0 spec defines a new mechanism for power role swap called Fast role swap. This change enables TCPM to support FRS when acting as sink. Once the explicit contract is negotiated, sink port is expected to query the source port for sink caps to determine whether the source is FRS capable. Bits

[PATCH v1 2/8] mm/swap: Do not abuse the seqcount_t latching API

2020-08-27 Thread Ahmed S. Darwish
Commit eef1a429f234 ("mm/swap.c: piggyback lru_add_drain_all() calls") implemented an optimization mechanism to exit the to-be-started LRU drain operation (name it A) if another drain operation *started and finished* while (A) was blocked on the LRU draining mutex. This was done through a

Re: [PATCH 09/14 v1] usb: typec: tcpm: Add support for Sink Fast Role SWAP(FRS)

2020-08-26 Thread kernel test robot
Hi Badhri, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on usb/usb-testing] [also build test WARNING on robh/for-next v5.9-rc2 next-20200826] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use

[PATCH 09/14 v1] usb: typec: tcpm: Add support for Sink Fast Role SWAP(FRS)

2020-08-24 Thread Badhri Jagan Sridharan
PD 3.0 spec defines a new mechanism for power role swap called Fast role swap. This change enables TCPM to support FRS when acting as sink. Once the explicit contract is negotiated, sink port is expected to query the source port for sink caps to determine whether the source is FRS capable. Bits

Re: [PATCH 3/3] mm/memcg: Unify swap and memsw page counters

2020-08-24 Thread Waiman Long
On 8/20/20 11:46 AM, Shakeel Butt wrote: On Thu, Aug 20, 2020 at 6:04 AM Waiman Long wrote: The swap page counter is v2 only while memsw is v1 only. As v1 and v2 controllers cannot be active at the same time, there is no point to keep both swap and memsw page counters in mem_cgroup

[PATCH v18 02/32] mm/memcg: bail out early from swap accounting when memcg is disabled

2020-08-24 Thread Alex Shi
If we disabled memcg by cgroup_disable=memory, page->memcg will be NULL and so the charge is skipped and that will trigger a warning like below. Let's return from the funcs earlier. anon flags:0x5005b48008000d(locked|uptodate|dirty|swapbacked) raw: 005005b48008000d dead0100

Re: [PATCH v2 1/9] spi: spi-s3c64xx: swap s3c64xx_spi_set_cs() and s3c64xx_enable_datapath()

2020-08-22 Thread Krzysztof Kozlowski
On Fri, Aug 21, 2020 at 06:13:53PM +0200, Łukasz Stelmach wrote: > This and the next patch fix issues with DMA transfers bigger than Just: "Fix issues with DMA transfers..." The order of patches could change when applying and backporting. Reviewed-by: Krzysztof Kozlowski Best regards,

[PATCH v2 rebased] swap: rename SWP_FS to SWAP_FS_OPS to avoid ambiguity

2020-08-22 Thread Gao Xiang
SWP_FS is used to make swap_{read,write}page() go through the filesystem, and it's only used for swap files over NFS for now. Otherwise it will directly submit IO to blockdev according to swapfile extents reported by filesystems in advance. As Matthew pointed out [1], SWP_FS naming is somewhat

[PATCH] swap: rename SWP_FS to SWAP_FS_OPS to avoid ambiguity

2020-08-22 Thread Gao Xiang
SWP_FS is used to make swap_{read,write}page() go through the filesystem, and it's only used for swap files over NFS for now. Otherwise it will directly submit IO to blockdev according to swapfile extents reported by filesystems in advance. As Matthew pointed out [1], SWP_FS naming is somewhat

[PATCH v2 1/9] spi: spi-s3c64xx: swap s3c64xx_spi_set_cs() and s3c64xx_enable_datapath()

2020-08-21 Thread Łukasz Stelmach
This and the next patch fix issues with DMA transfers bigger than 512 bytes on Exynos3250. Without the patches such transfers fail to complete. This solution to the problem is found in the vendor kernel for ARTIK5 boards based on Exynos3250. Signed-off-by: Łukasz Stelmach ---

Re: [PATCH v2] mm, THP, swap: fix allocating cluster for swapfile by mistake

2020-08-20 Thread Huang, Ying
to make swap_{read,write}page() go through >> > > the filesystem, and it's only used for swap files over >> > > NFS. So, !SWP_FS means non NFS for now, it could be either >> > > file backed or device backed. Something similar goes with >> > > legacy SWP_FIL

Re: [PATCH v2] mm, THP, swap: fix allocating cluster for swapfile by mistake

2020-08-20 Thread Dave Chinner
gt; > the filesystem, and it's only used for swap files over > > > NFS. So, !SWP_FS means non NFS for now, it could be either > > > file backed or device backed. Something similar goes with > > > legacy SWP_FILE. > > > > > > So in order to a

Re: [PATCH v2] mm, THP, swap: fix allocating cluster for swapfile by mistake

2020-08-20 Thread Rafael Aquini
On Fri, Aug 21, 2020 at 09:34:46AM +1000, Dave Chinner wrote: > On Thu, Aug 20, 2020 at 12:53:23PM +0800, Gao Xiang wrote: > > SWP_FS is used to make swap_{read,write}page() go through > > the filesystem, and it's only used for swap files over > > NFS. So, !SWP_FS means non

Re: [PATCH v2] mm, THP, swap: fix allocating cluster for swapfile by mistake

2020-08-20 Thread Gao Xiang
Hi Dave, On Fri, Aug 21, 2020 at 09:34:46AM +1000, Dave Chinner wrote: > On Thu, Aug 20, 2020 at 12:53:23PM +0800, Gao Xiang wrote: > > SWP_FS is used to make swap_{read,write}page() go through > > the filesystem, and it's only used for swap files over > > NFS. So, !SWP_FS

Re: [PATCH v2] mm, THP, swap: fix allocating cluster for swapfile by mistake

2020-08-20 Thread Dave Chinner
On Thu, Aug 20, 2020 at 12:53:23PM +0800, Gao Xiang wrote: > SWP_FS is used to make swap_{read,write}page() go through > the filesystem, and it's only used for swap files over > NFS. So, !SWP_FS means non NFS for now, it could be either > file backed or device backed. Something

Re: [PATCH v2] mm, THP, swap: fix allocating cluster for swapfile by mistake

2020-08-20 Thread Rafael Aquini
On Thu, Aug 20, 2020 at 12:53:23PM +0800, Gao Xiang wrote: > SWP_FS is used to make swap_{read,write}page() go through > the filesystem, and it's only used for swap files over > NFS. So, !SWP_FS means non NFS for now, it could be either > file backed or device backed. Something

Re: [PATCH 3/3] mm/memcg: Unify swap and memsw page counters

2020-08-20 Thread Shakeel Butt
On Thu, Aug 20, 2020 at 6:04 AM Waiman Long wrote: > > The swap page counter is v2 only while memsw is v1 only. As v1 and v2 > controllers cannot be active at the same time, there is no point to keep > both swap and memsw page counters in mem_cgroup. The previous patch has > made

Re: [PATCH v2] mm, THP, swap: fix allocating cluster for swapfile by mistake

2020-08-20 Thread Yang Shi
On Wed, Aug 19, 2020 at 9:54 PM Gao Xiang wrote: > > SWP_FS is used to make swap_{read,write}page() go through > the filesystem, and it's only used for swap files over > NFS. So, !SWP_FS means non NFS for now, it could be either > file backed or device backed. Something similar goe

[PATCH 3/3] mm/memcg: Unify swap and memsw page counters

2020-08-20 Thread Waiman Long
The swap page counter is v2 only while memsw is v1 only. As v1 and v2 controllers cannot be active at the same time, there is no point to keep both swap and memsw page counters in mem_cgroup. The previous patch has made sure that memsw page counter is updated and accessed only when in v1 code

Re: [PATCH v2] mm, THP, swap: fix allocating cluster for swapfile by mistake

2020-08-20 Thread Gao Xiang
Hi Matthew, On Thu, Aug 20, 2020 at 12:34:48PM +0100, Matthew Wilcox wrote: > On Thu, Aug 20, 2020 at 12:53:23PM +0800, Gao Xiang wrote: > > SWP_FS is used to make swap_{read,write}page() go through > > the filesystem, and it's only used for swap files over > > NFS. So,

Re: [PATCH v2] mm, THP, swap: fix allocating cluster for swapfile by mistake

2020-08-20 Thread Matthew Wilcox
On Thu, Aug 20, 2020 at 12:53:23PM +0800, Gao Xiang wrote: > SWP_FS is used to make swap_{read,write}page() go through > the filesystem, and it's only used for swap files over > NFS. So, !SWP_FS means non NFS for now, it could be either > file backed or device backed. Something

Re: [PATCH 1/8] spi: spi-s3c64xx: swap s3c64xx_spi_set_cs() and s3c64xx_enable_datapath()

2020-08-20 Thread Lukasz Stelmach
It was <2020-08-19 śro 20:12>, when Mark Brown wrote: > On Wed, Aug 19, 2020 at 04:01:52PM +0200, Lukasz Stelmach wrote: >> It was <2020-08-19 śro 14:16>, when Mark Brown wrote: >>> On Wed, Aug 19, 2020 at 02:58:22PM +0200, Krzysztof Kozlowski wrote: On Wed, Aug 19, 2020 at 02:51:27PM +0200,

Re: [PATCH v2] mm, THP, swap: fix allocating cluster for swapfile by mistake

2020-08-19 Thread Huang, Ying
Gao Xiang writes: > SWP_FS is used to make swap_{read,write}page() go through > the filesystem, and it's only used for swap files over > NFS. So, !SWP_FS means non NFS for now, it could be either > file backed or device backed. Something similar goes with > legacy SWP_FILE.

[PATCH v2] mm, THP, swap: fix allocating cluster for swapfile by mistake

2020-08-19 Thread Gao Xiang
SWP_FS is used to make swap_{read,write}page() go through the filesystem, and it's only used for swap files over NFS. So, !SWP_FS means non NFS for now, it could be either file backed or device backed. Something similar goes with legacy SWP_FILE. So in order to achieve the goal of the original

Re: [PATCH] mm, THP, swap: fix allocating cluster for swapfile by mistake

2020-08-19 Thread Gao Xiang
Hi Ying, On Thu, Aug 20, 2020 at 12:36:08PM +0800, Huang, Ying wrote: > Gao Xiang writes: > > > SWP_FS doesn't mean the device is file-backed swap device, > > which just means each writeback request should go through fs > > by DIO. Or it'll just use extents

Re: [PATCH] mm, THP, swap: fix allocating cluster for swapfile by mistake

2020-08-19 Thread Huang, Ying
Gao Xiang writes: > SWP_FS doesn't mean the device is file-backed swap device, > which just means each writeback request should go through fs > by DIO. Or it'll just use extents added by .swap_activate(), > but it also works as file-backed swap device. > > So in order t

Re: [PATCH] mm, THP, swap: fix allocating cluster for swapfile by mistake

2020-08-19 Thread Gao Xiang
wrote: > > > > > > > SWP_FS doesn't mean the device is file-backed swap device, > > > > which just means each writeback request should go through fs > > > > by DIO. Or it'll just use extents added by .swap_activate(), > > > > but it also wo

Re: [PATCH] mm, THP, swap: fix allocating cluster for swapfile by mistake

2020-08-19 Thread Yang Shi
On Wed, Aug 19, 2020 at 1:15 PM Gao Xiang wrote: > > Hi Andrew, > > On Wed, Aug 19, 2020 at 01:05:06PM -0700, Andrew Morton wrote: > > On Thu, 20 Aug 2020 03:56:13 +0800 Gao Xiang wrote: > > > > > SWP_FS doesn't mean the device is file-backed swap device, >

Re: [PATCH] mm, THP, swap: fix allocating cluster for swapfile by mistake

2020-08-19 Thread Gao Xiang
Hi Rafael, On Wed, Aug 19, 2020 at 04:44:05PM -0400, Rafael Aquini wrote: > On Wed, Aug 19, 2020 at 01:05:06PM -0700, Andrew Morton wrote: > > On Thu, 20 Aug 2020 03:56:13 +0800 Gao Xiang wrote: > > > > > SWP_FS doesn't mean the device is file-backed swap device, >

Re: [PATCH] mm, THP, swap: fix allocating cluster for swapfile by mistake

2020-08-19 Thread Rafael Aquini
On Wed, Aug 19, 2020 at 01:05:06PM -0700, Andrew Morton wrote: > On Thu, 20 Aug 2020 03:56:13 +0800 Gao Xiang wrote: > > > SWP_FS doesn't mean the device is file-backed swap device, > > which just means each writeback request should go through fs > > by DIO. Or it'l

Re: [PATCH] mm, THP, swap: fix allocating cluster for swapfile by mistake

2020-08-19 Thread Gao Xiang
Hi Andrew, On Wed, Aug 19, 2020 at 01:05:06PM -0700, Andrew Morton wrote: > On Thu, 20 Aug 2020 03:56:13 +0800 Gao Xiang wrote: > > > SWP_FS doesn't mean the device is file-backed swap device, > > which just means each writeback request should go through fs > > by DIO. O

Re: [PATCH] mm, THP, swap: fix allocating cluster for swapfile by mistake

2020-08-19 Thread Andrew Morton
On Thu, 20 Aug 2020 03:56:13 +0800 Gao Xiang wrote: > SWP_FS doesn't mean the device is file-backed swap device, > which just means each writeback request should go through fs > by DIO. Or it'll just use extents added by .swap_activate(), > but it also works as file-backed

[PATCH] mm, THP, swap: fix allocating cluster for swapfile by mistake

2020-08-19 Thread Gao Xiang
SWP_FS doesn't mean the device is file-backed swap device, which just means each writeback request should go through fs by DIO. Or it'll just use extents added by .swap_activate(), but it also works as file-backed swap device. So in order to achieve the goal of the original patch, SWP_BLKDEV

<    1   2   3   4   5   6   7   8   9   10   >