[PATCH v3] mm: memcontrol: fix swap undercounting in cgroup2

2021-02-17 Thread Muchun Song
When pages are swapped in, the VM may retain the swap copy to avoid repeated writes in the future. It's also retained if shared pages are faulted back in some processes, but not in others. During that time we have an in-memory copy of the page, as well as an on-swap copy. Cgroup1 and cgroup2

Re: [External] Re: [PATCH v2] mm: memcontrol: fix swap undercounting in cgroup2

2021-02-17 Thread Muchun Song
On Wed, Feb 17, 2021 at 10:39 PM Shakeel Butt wrote: > > On Wed, Feb 17, 2021 at 3:09 AM Muchun Song wrote: > > > > When pages are swapped in, the VM may retain the swap copy to avoid > > repeated writes in the future. It's also retained if shared pages are > >

Re: [PATCH v2] mm: memcontrol: fix swap undercounting in cgroup2

2021-02-17 Thread Shakeel Butt
On Wed, Feb 17, 2021 at 3:09 AM Muchun Song wrote: > > When pages are swapped in, the VM may retain the swap copy to avoid > repeated writes in the future. It's also retained if shared pages are > faulted back in some processes, but not in others. During that time we > have an

[PATCH v2] mm: memcontrol: fix swap undercounting in cgroup2

2021-02-17 Thread Muchun Song
When pages are swapped in, the VM may retain the swap copy to avoid repeated writes in the future. It's also retained if shared pages are faulted back in some processes, but not in others. During that time we have an in-memory copy of the page, as well as an on-swap copy. Cgroup1 and cgroup2

Re: [External] Re: [PATCH 4/4] mm: memcontrol: fix swap uncharge on cgroup v2

2021-02-16 Thread Muchun Song
On Wed, Feb 17, 2021 at 1:28 AM Johannes Weiner wrote: > > On Tue, Feb 16, 2021 at 11:59:01AM -0500, Johannes Weiner wrote: > > Hello Muchun, > > > > On Sat, Feb 13, 2021 at 01:01:59AM +0800, Muchun Song wrote: > > > The swap charges the actual number of swap entr

Re: [External] Re: [PATCH 4/4] mm: memcontrol: fix swap uncharge on cgroup v2

2021-02-16 Thread Muchun Song
On Wed, Feb 17, 2021 at 12:59 AM Johannes Weiner wrote: > > Hello Muchun, > > On Sat, Feb 13, 2021 at 01:01:59AM +0800, Muchun Song wrote: > > The swap charges the actual number of swap entries on cgroup v2. > > If a swap cache page is charged successful, and then we uncha

Re: [PATCH 4/4] mm: memcontrol: fix swap uncharge on cgroup v2

2021-02-16 Thread Johannes Weiner
On Tue, Feb 16, 2021 at 11:59:01AM -0500, Johannes Weiner wrote: > Hello Muchun, > > On Sat, Feb 13, 2021 at 01:01:59AM +0800, Muchun Song wrote: > > The swap charges the actual number of swap entries on cgroup v2. > > If a swap cache page is charged successful, and then we

Re: [PATCH 4/4] mm: memcontrol: fix swap uncharge on cgroup v2

2021-02-16 Thread Michal Hocko
On Tue 16-02-21 11:59:00, Johannes Weiner wrote: > Hello Muchun, > > On Sat, Feb 13, 2021 at 01:01:59AM +0800, Muchun Song wrote: > > The swap charges the actual number of swap entries on cgroup v2. > > If a swap cache page is charged successful, and then we uncharge

Re: [PATCH 4/4] mm: memcontrol: fix swap uncharge on cgroup v2

2021-02-16 Thread Shakeel Butt
On Tue, Feb 16, 2021 at 9:05 AM Johannes Weiner wrote: > > Hello Muchun, > > On Sat, Feb 13, 2021 at 01:01:59AM +0800, Muchun Song wrote: > > The swap charges the actual number of swap entries on cgroup v2. > > If a swap cache page is charged successful, and then we uncha

Re: [External] Re: [PATCH 4/4] mm: memcontrol: fix swap uncharge on cgroup v2

2021-02-16 Thread Shakeel Butt
On Fri, Feb 12, 2021 at 10:48 PM Muchun Song wrote: > > On Sat, Feb 13, 2021 at 2:57 AM Shakeel Butt wrote: > > > > CCing more folks. > > > > On Fri, Feb 12, 2021 at 9:14 AM Muchun Song > > wrote: > > > > > > The swap charges the actua

Re: [PATCH 4/4] mm: memcontrol: fix swap uncharge on cgroup v2

2021-02-16 Thread Johannes Weiner
Hello Muchun, On Sat, Feb 13, 2021 at 01:01:59AM +0800, Muchun Song wrote: > The swap charges the actual number of swap entries on cgroup v2. > If a swap cache page is charged successful, and then we uncharge > the swap counter. It is wrong on cgroup v2. Because the swap > entry

[PATCH] coccinelle: misc: add swap script

2021-02-16 Thread Denis Efremov
Check for opencoded swap() implementation. Signed-off-by: Denis Efremov --- scripts/coccinelle/misc/swap.cocci | 77 ++ 1 file changed, 77 insertions(+) create mode 100644 scripts/coccinelle/misc/swap.cocci diff --git a/scripts/coccinelle/misc/swap.cocci b/scripts

Re: [External] Re: [PATCH 4/4] mm: memcontrol: fix swap uncharge on cgroup v2

2021-02-15 Thread Michal Hocko
On Mon 15-02-21 18:15:36, Muchun Song wrote: > On Mon, Feb 15, 2021 at 5:47 PM Michal Hocko wrote: > > > > On Sat 13-02-21 01:01:59, Muchun Song wrote: > > > The swap charges the actual number of swap entries on cgroup v2. > > > If a swap cache page is charged

Re: [External] Re: [PATCH 4/4] mm: memcontrol: fix swap uncharge on cgroup v2

2021-02-15 Thread Muchun Song
On Mon, Feb 15, 2021 at 5:47 PM Michal Hocko wrote: > > On Sat 13-02-21 01:01:59, Muchun Song wrote: > > The swap charges the actual number of swap entries on cgroup v2. > > If a swap cache page is charged successful, and then we uncharge > > the swap counter. It is wro

Re: [PATCH 4/4] mm: memcontrol: fix swap uncharge on cgroup v2

2021-02-15 Thread Michal Hocko
On Sat 13-02-21 01:01:59, Muchun Song wrote: > The swap charges the actual number of swap entries on cgroup v2. > If a swap cache page is charged successful, and then we uncharge > the swap counter. It is wrong on cgroup v2. Because the swap > entry is not freed. Is there any ac

Re: [External] Re: [PATCH 4/4] mm: memcontrol: fix swap uncharge on cgroup v2

2021-02-12 Thread Muchun Song
On Sat, Feb 13, 2021 at 2:57 AM Shakeel Butt wrote: > > CCing more folks. > > On Fri, Feb 12, 2021 at 9:14 AM Muchun Song wrote: > > > > The swap charges the actual number of swap entries on cgroup v2. > > If a swap cache page is charged successful, and then we

Re: [PATCH 4/4] mm: memcontrol: fix swap uncharge on cgroup v2

2021-02-12 Thread Shakeel Butt
CCing more folks. On Fri, Feb 12, 2021 at 9:14 AM Muchun Song wrote: > > The swap charges the actual number of swap entries on cgroup v2. > If a swap cache page is charged successful, and then we uncharge > the swap counter. It is wrong on cgroup v2. Because the swap > ent

[PATCH 4/4] mm: memcontrol: fix swap uncharge on cgroup v2

2021-02-12 Thread Muchun Song
The swap charges the actual number of swap entries on cgroup v2. If a swap cache page is charged successful, and then we uncharge the swap counter. It is wrong on cgroup v2. Because the swap entry is not freed. Fixes: 2d1c498072de ("mm: memcontrol: make swap tracking an integral part of m

[PATCH 4.19 07/17] platform/x86: touchscreen_dmi: Add swap-x-y quirk for Goodix touchscreen on Estar Beauty HD tablet

2021-02-05 Thread Greg Kroah-Hartman
From: Hans de Goede [ Upstream commit 46c54cf2706122c37497896d56d67b0c0aca2ede ] The Estar Beauty HD (MID 7316R) tablet uses a Goodix touchscreen, with the X and Y coordinates swapped compared to the LCD panel. Add a touchscreen_dmi entry for this adding a "touchscreen-swapped-x-y"

[PATCH 5.10 21/57] platform/x86: touchscreen_dmi: Add swap-x-y quirk for Goodix touchscreen on Estar Beauty HD tablet

2021-02-05 Thread Greg Kroah-Hartman
From: Hans de Goede [ Upstream commit 46c54cf2706122c37497896d56d67b0c0aca2ede ] The Estar Beauty HD (MID 7316R) tablet uses a Goodix touchscreen, with the X and Y coordinates swapped compared to the LCD panel. Add a touchscreen_dmi entry for this adding a "touchscreen-swapped-x-y"

[PATCH 5.4 15/32] platform/x86: touchscreen_dmi: Add swap-x-y quirk for Goodix touchscreen on Estar Beauty HD tablet

2021-02-05 Thread Greg Kroah-Hartman
From: Hans de Goede [ Upstream commit 46c54cf2706122c37497896d56d67b0c0aca2ede ] The Estar Beauty HD (MID 7316R) tablet uses a Goodix touchscreen, with the X and Y coordinates swapped compared to the LCD panel. Add a touchscreen_dmi entry for this adding a "touchscreen-swapped-x-y"

Re: [RFC][PATCH 11/13] mm/vmscan: Consider anonymous pages without swap

2021-02-02 Thread Yang Shi
On Tue, Feb 2, 2021 at 1:35 PM Dave Hansen wrote: > > On 2/2/21 10:56 AM, Yang Shi wrote: > >> > >> /* If we have no swap space, do not bother scanning anon pages. */ > >> - if (!sc->may_swap || mem_cgroup_get_nr_swap_pages(memcg) &l

Re: [RFC][PATCH 11/13] mm/vmscan: Consider anonymous pages without swap

2021-02-02 Thread Dave Hansen
On 2/2/21 10:56 AM, Yang Shi wrote: >> >> /* If we have no swap space, do not bother scanning anon pages. */ >> - if (!sc->may_swap || mem_cgroup_get_nr_swap_pages(memcg) <= 0) { >> + if (!sc->may_swap || !can_reclaim_anon_pages(memcg, pgdat-

[PATCH 5.4 13/61] PM: hibernate: flush swap writer after marking

2021-02-02 Thread Greg Kroah-Hartman
From: Laurent Badel commit fef9c8d28e28a808274a18fbd8cc2685817fd62a upstream. Flush the swap writer after, not before, marking the files, to ensure the signature is properly written. Fixes: 6f612af57821 ("PM / Hibernate: Group swap ops") Signed-off-by: Laurent Badel Cc: All

Re: [RFC][PATCH 11/13] mm/vmscan: Consider anonymous pages without swap

2021-02-02 Thread Yang Shi
On Mon, Jan 25, 2021 at 4:42 PM 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 4.19 10/37] PM: hibernate: flush swap writer after marking

2021-02-02 Thread Greg Kroah-Hartman
From: Laurent Badel commit fef9c8d28e28a808274a18fbd8cc2685817fd62a upstream. Flush the swap writer after, not before, marking the files, to ensure the signature is properly written. Fixes: 6f612af57821 ("PM / Hibernate: Group swap ops") Signed-off-by: Laurent Badel Cc: All

[PATCH 5.10 031/142] PM: hibernate: flush swap writer after marking

2021-02-02 Thread Greg Kroah-Hartman
From: Laurent Badel commit fef9c8d28e28a808274a18fbd8cc2685817fd62a upstream. Flush the swap writer after, not before, marking the files, to ensure the signature is properly written. Fixes: 6f612af57821 ("PM / Hibernate: Group swap ops") Signed-off-by: Laurent Badel Cc: All

Re: [PATCH] mm/page_io: Use pr_alert_ratelimited for swap read/write errors

2021-02-01 Thread Miaohe Lin
Hi: On 2021/2/1 22:20, Georgi Djakov wrote: > If there are errors during swap read or write, they can easily fill > the log buffer and remove any previous messages that might be useful > for debugging, especially on systems that rely for logging only on > the kernel ring-buffer. >

Re: [PATCH] mm/page_io: Use pr_alert_ratelimited for swap read/write errors

2021-02-01 Thread Minchan Kim
On Mon, Feb 01, 2021 at 04:20:55PM +0200, Georgi Djakov wrote: > If there are errors during swap read or write, they can easily fill > the log buffer and remove any previous messages that might be useful > for debugging, especially on systems that rely for logging only on > the kernel

[PATCH] mm/page_io: Use pr_alert_ratelimited for swap read/write errors

2021-02-01 Thread Georgi Djakov
If there are errors during swap read or write, they can easily fill the log buffer and remove any previous messages that might be useful for debugging, especially on systems that rely for logging only on the kernel ring-buffer. For example, on a systems using zram as swap, we are more likely

Re: [RFC PATCH 29/34] power/swap: use bio_new in hib_submit_io

2021-01-28 Thread Rafael J. Wysocki
On Thu, Jan 28, 2021 at 8:21 AM Chaitanya Kulkarni wrote: > Please explain in the changelog why making this change is a good idea. > Signed-off-by: Chaitanya Kulkarni > --- > kernel/power/swap.c | 7 +++ > 1 file changed, 3 insertions(+), 4 deletions(-) > > diff --git

[RFC PATCH 29/34] power/swap: use bio_new in hib_submit_io

2021-01-27 Thread Chaitanya Kulkarni
Signed-off-by: Chaitanya Kulkarni --- kernel/power/swap.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/kernel/power/swap.c b/kernel/power/swap.c index c73f2e295167..e92e36c053a6 100644 --- a/kernel/power/swap.c +++ b/kernel/power/swap.c @@ -271,13 +271,12 @@ static

[RFC][PATCH 11/13] mm/vmscan: Consider anonymous pages without swap

2021-01-26 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] swap: Check nrexceptional of swap cache before being freed

2021-01-21 Thread Huang, Ying
Matthew Wilcox writes: > On Wed, Jan 20, 2021 at 03:27:11PM +0800, Huang Ying wrote: >> To catch the error in updating the swap cache shadow entries or their count. > > I just resent a patch that removes nrexceptional tracking. > > Can you use !mapping_empty() inst

Re: [PATCH] swap: Check nrexceptional of swap cache before being freed

2021-01-21 Thread Matthew Wilcox
On Wed, Jan 20, 2021 at 03:27:11PM +0800, Huang Ying wrote: > To catch the error in updating the swap cache shadow entries or their count. I just resent a patch that removes nrexceptional tracking. Can you use !mapping_empty() instead? > void exit_swap_address_space(unsigned in

Re: [PATCH] swap: Check nrexceptional of swap cache before being freed

2021-01-20 Thread Michal Hocko
On Wed 20-01-21 15:54:04, Huang, Ying wrote: > Michal Hocko writes: > > > On Wed 20-01-21 15:27:11, Huang Ying wrote: > >> To catch the error in updating the swap cache shadow entries or their > >> count. > > > > What is the error? > > There's n

Re: [PATCH] swap: Check nrexceptional of swap cache before being freed

2021-01-19 Thread Huang, Ying
Michal Hocko writes: > On Wed 20-01-21 15:27:11, Huang Ying wrote: >> To catch the error in updating the swap cache shadow entries or their count. > > What is the error? There's no error in the current code. But we will change the related code in the future. So this checki

Re: [PATCH] swap: Check nrexceptional of swap cache before being freed

2021-01-19 Thread Michal Hocko
On Wed 20-01-21 15:27:11, Huang Ying wrote: > To catch the error in updating the swap cache shadow entries or their count. What is the error? Can it happens in the real life? Why do we need this patch? Is crashing the kernel the right way to handle the situation? > Signed-off-by: "

[PATCH] swap: Check nrexceptional of swap cache before being freed

2021-01-19 Thread Huang Ying
To catch the error in updating the swap cache shadow entries or their count. Signed-off-by: "Huang, Ying" Cc: Minchan Kim Cc: Joonsoo Kim , Cc: Johannes Weiner , Cc: Vlastimil Babka , Hugh Dickins , Cc: Mel Gorman , Cc: Michal Hocko , Cc: Dan Williams , Cc: Christoph Hellwig , Il

Re: [PATCH RFC 07/30] mm/swap: Introduce the idea of special swap ptes

2021-01-19 Thread Peter Xu
On Mon, Jan 18, 2021 at 03:40:13PM -0400, Jason Gunthorpe wrote: > Does the stuff in hmm.c need updating too? > > if (!pte_present(pte)) { > swp_entry_t entry = pte_to_swp_entry(pte); This idea should be cross-tree, so yes.. even if I'm not 100% sure whether HMM would be

Re: [PATCH RFC 07/30] mm/swap: Introduce the idea of special swap ptes

2021-01-18 Thread Jason Gunthorpe
On Fri, Jan 15, 2021 at 12:08:44PM -0500, Peter Xu wrote: > We used to have special swap entries, like migration entries, hw-poison > entries, device private entries, etc. > > Those "special swap entries" reside in the range that they need to be at least > swap entri

[PATCH 5.10 111/152] mm: dont put pinned pages into the swap cache

2021-01-18 Thread Greg Kroah-Hartman
From: Linus Torvalds [ Upstream commit feb889fb40fafc699cf1cca8f770126819fb ] So technically there is nothing wrong with adding a pinned page to the swap cache, but the pinning obviously means that the page can't actually be free'd right now anyway, so it's a bit pointless. However

[PATCH RFC 07/30] mm/swap: Introduce the idea of special swap ptes

2021-01-15 Thread Peter Xu
We used to have special swap entries, like migration entries, hw-poison entries, device private entries, etc. Those "special swap entries" reside in the range that they need to be at least swap entries first, and their types are decided by swp_type(entry). This patch introduces an

[PATCH RFC 17/30] shmem/userfaultfd: Pass over uffd-wp special swap pte when fork()

2021-01-15 Thread Peter Xu
age; - swp_entry_t entry = pte_to_swp_entry(pte); + swp_entry_t entry; + + if (unlikely(is_swap_special_pte(pte))) { + /* +* uffd-wp special swap pte is the only possibility for now. +* If dst vma is registered with uffd-wp, copy it o

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

2021-01-15 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 dd2acb8b3f0f

[PATCH RFC 16/30] shmem/userfaultfd: Handle the left-overed special swap ptes

2021-01-15 Thread Peter Xu
Note that the special uffd-wp swap pte can be left over even if the page under the pte got evicted. Normally when evict a page, we will unmap the ptes by walking through the reverse mapping. However we never tracked such information for the special swap ptes because they're not real mappings

Re: [PATCH] mm: Free unused swap cache page in write protection fault handler

2021-01-15 Thread Huang, Ying
Linus Torvalds writes: > On Tue, Jan 12, 2021 at 9:24 PM huang ying > wrote: >> > >> > Couldn't we just move it to the tail of the LRU list so it's reclaimed >> > first? Or is locking going to be a problem here? >> >> Yes. That's a way to reduce the disturbance to the page reclaiming. >> For

Re: [PATCH] mm: Free unused swap cache page in write protection fault handler

2021-01-13 Thread Linus Torvalds
On Tue, Jan 12, 2021 at 9:24 PM huang ying wrote: > > > > Couldn't we just move it to the tail of the LRU list so it's reclaimed > > first? Or is locking going to be a problem here? > > Yes. That's a way to reduce the disturbance to the page reclaiming. > For LRU lock contention, is it

Re: [PATCH] mm: Free unused swap cache page in write protection fault handler

2021-01-12 Thread huang ying
; > > > > > > So in this patch, at the end of wp_page_copy(), the old unused swap > > > > cache page will be tried to be freed. > > > > > > I'd much rather free it later when needed, rather than when you're in > > > a COW section. > > >

Re: [PATCH] mm: Free unused swap cache page in write protection fault handler

2021-01-12 Thread Matthew Wilcox
On Wed, Jan 13, 2021 at 11:08:56AM +0800, huang ying wrote: > On Wed, Jan 13, 2021 at 10:47 AM Linus Torvalds > wrote: > > > > On Tue, Jan 12, 2021 at 6:43 PM Huang Ying wrote: > > > > > > So in this patch, at the end of wp_page_copy(), the old unused

Re: [PATCH] mm: Free unused swap cache page in write protection fault handler

2021-01-12 Thread huang ying
On Wed, Jan 13, 2021 at 10:47 AM Linus Torvalds wrote: > > On Tue, Jan 12, 2021 at 6:43 PM Huang Ying wrote: > > > > So in this patch, at the end of wp_page_copy(), the old unused swap > > cache page will be tried to be freed. > > I'd much rather free it later

Re: [PATCH] mm: Free unused swap cache page in write protection fault handler

2021-01-12 Thread Linus Torvalds
On Tue, Jan 12, 2021 at 6:43 PM Huang Ying wrote: > > So in this patch, at the end of wp_page_copy(), the old unused swap > cache page will be tried to be freed. I'd much rather free it later when needed, rather than when you're in a COW section. Linus

[PATCH] mm: Free unused swap cache page in write protection fault handler

2021-01-12 Thread Huang Ying
77924 1419724 Swap: 1048572 0 0 The AnonPages filed of /proc/meminfo is 11712 kB. After running a memory eater which will trigger many swapins and write protection faults, the free memory becomes, totalusedfree shared buff/cache ava

Re: [mm/swap] aae466b005: vm-scalability.throughput -2.7% regression

2021-01-03 Thread Joonsoo Kim
On Wed, Dec 30, 2020 at 02:24:12PM +0800, kernel test robot wrote: > > Greeting, > > FYI, we noticed a -2.7% regression of vm-scalability.throughput due to commit: > > > commit: aae466b0052e1888edd1d7f473d4310d64936196 ("mm/swap: implement > workingset detectio

[PATCH 15/25] mm/swap: Convert rotate_reclaimable_page to folio

2020-12-16 Thread Matthew Wilcox (Oracle)
kly. * -* Also clear PG_reclaim to avoid rotate_reclaimable_page() +* Also clear PG_reclaim to avoid rotate_reclaimable_folio() */ set_page_dirty(page); pr_alert("Write-error on swap-device (%u:%u:%llu)\n", @@

[PATCH 05/15] perf tools: Do not swap mmap2 fields in case it contains build id

2020-12-14 Thread Jiri Olsa
; }; struct { u8build_id_size; u8__reserved_1; u16 __reserved_2; u8build_id[20]; }; }; In this case we can't swap above fields. Signed-off-by: Jiri Olsa --- tools/perf/util

[RFC PATCH 11/11] mm/swap: Convert rotate_reclaimable_page to folio

2020-12-08 Thread Matthew Wilcox (Oracle)
kly. * -* Also clear PG_reclaim to avoid rotate_reclaimable_page() +* Also clear PG_reclaim to avoid rotate_reclaimable_folio() */ set_page_dirty(page); pr_alert("Write-error on swap-device (%u:%u:%llu)\n", @@

Re: [PATCH 06/25] perf tools: Do not swap mmap2 fields in case it contains build id

2020-11-28 Thread Jiri Olsa
u8build_id[20]; > > u8build_id_size; > > u8__reserved_1; > > u16 __reserved_2; > > }; > > }; > > Did you forgot to update just this cset comment? ah yes, will fix t

Re: [PATCH 06/25] perf tools: Do not swap mmap2 fields in case it contains build id

2020-11-26 Thread Arnaldo Carvalho de Melo
> u16 __reserved_2; > }; > }; Did you forgot to update just this cset comment? - Arnaldo > In this case we can't swap above fields. > > Signed-off-by: Jiri Olsa > --- > tools/perf/util/session.c | 11 +++ > 1 file changed, 7 insertions(+), 4 delet

[PATCH 06/25] perf tools: Do not swap mmap2 fields in case it contains build id

2020-11-26 Thread Jiri Olsa
; }; struct { u8build_id[20]; u8build_id_size; u8__reserved_1; u16 __reserved_2; }; }; In this case we can't swap above fields. Signed-off-by: Jiri Olsa --- tools/perf/util

[PATCH] microblaze: Swap location of bss and INIT_RAM_FS

2020-11-25 Thread Michal Simek
Microblaze is doing early mapping with two TLBs with 16MB each. It means machine_early_init() with MMU ON can work just with 32MB memory max. If kernel includes initramfs which increase kernel footprint above 32MB bss section can't be clear and HW exception happens because memory is not mapped.

Re: [PATCH 1/3] ibmvfc: byte swap login_buf.resp values in attribute show functions

2020-11-23 Thread Martin K. Petersen
g endian format. > > Byte swap these values to host cpu endian format for better human > readability. Applied to 5.11/scsi-queue, thanks! [1/3] scsi: ibmvfc: Byte swap login_buf.resp values in attribute show functions https://git.kernel.org/mkp/scsi/c/61bdb4eec8d1 [2/3] scsi: ibmvfc: R

[PATCH 06/25] perf tools: Do not swap mmap2 fields in case it contains build id

2020-11-23 Thread Jiri Olsa
; }; struct { u8build_id[20]; u8build_id_size; u8__reserved_1; u16 __reserved_2; }; }; In this case we can't swap above fields. Signed-off-by: Jiri Olsa --- tools/perf/util

Re: [PATCH 1/3] ibmvfc: byte swap login_buf.resp values in attribute show functions

2020-11-19 Thread Martin K. Petersen
Tyrel, > Both ibmvfc_show_host_(capabilities|npiv_version) functions retrieve > values from vhost->login_buf.resp buffer. This is the MAD response > buffer from the VIOS and as such any multi-byte non-string values are in > big endian format. Applied 1-3 to 5.11/scsi-staging, thanks! --

[PATCH 1/3] ibmvfc: byte swap login_buf.resp values in attribute show functions

2020-11-17 Thread Tyrel Datwyler
Both ibmvfc_show_host_(capabilities|npiv_version) functions retrieve values from vhost->login_buf.resp buffer. This is the MAD response buffer from the VIOS and as such any multi-byte non-string values are in big endian format. Byte swap these values to host cpu endian format for better hu

[PATCH 4.14 11/85] perf tools: Add missing swap for ino_generation

2020-11-17 Thread Greg Kroah-Hartman
From: Jiri Olsa [ Upstream commit fe01adb72356a4e2f8735e4128af85921ca98fa1 ] We are missing swap for ino_generation field. Fixes: 5c5e854bc760 ("perf tools: Add attr->mmap2 support") Signed-off-by: Jiri Olsa Acked-by: Namhyung Kim Link: https://lore.kernel.org/r/20201101233103

[PATCH 4.19 013/101] perf tools: Add missing swap for ino_generation

2020-11-17 Thread Greg Kroah-Hartman
From: Jiri Olsa [ Upstream commit fe01adb72356a4e2f8735e4128af85921ca98fa1 ] We are missing swap for ino_generation field. Fixes: 5c5e854bc760 ("perf tools: Add attr->mmap2 support") Signed-off-by: Jiri Olsa Acked-by: Namhyung Kim Link: https://lore.kernel.org/r/20201101233103

[PATCH 5.4 022/151] perf tools: Add missing swap for ino_generation

2020-11-17 Thread Greg Kroah-Hartman
From: Jiri Olsa [ Upstream commit fe01adb72356a4e2f8735e4128af85921ca98fa1 ] We are missing swap for ino_generation field. Fixes: 5c5e854bc760 ("perf tools: Add attr->mmap2 support") Signed-off-by: Jiri Olsa Acked-by: Namhyung Kim Link: https://lore.kernel.org/r/20201101233103

[PATCH 5.9 049/255] can: j1939: swap addr and pgn in the send example

2020-11-17 Thread Greg Kroah-Hartman
From: Yegor Yefremov [ Upstream commit ea780d39b1888ed5afc243c29b23d9bdb3828c7a ] The address was wrongly assigned to the PGN field and vice versa. Signed-off-by: Yegor Yefremov Link: https://lore.kernel.org/r/20201022083708.8755-1-yegorsli...@googlemail.com Fixes: 9d71dd0c7009 ("can: add

[PATCH 5.9 038/255] perf tools: Add missing swap for cgroup events

2020-11-17 Thread Greg Kroah-Hartman
From: Namhyung Kim [ Upstream commit 2c589d933e54d183ee2a052971b730e423c62031 ] It was missed to add a swap function for PERF_RECORD_CGROUP. Fixes: ba78c1c5461c ("perf tools: Basic support for CGROUP event") Signed-off-by: Namhyung Kim Acked-by: Jiri Olsa Cc: Alexander Shishki

[PATCH 5.9 037/255] perf tools: Add missing swap for ino_generation

2020-11-17 Thread Greg Kroah-Hartman
From: Jiri Olsa [ Upstream commit fe01adb72356a4e2f8735e4128af85921ca98fa1 ] We are missing swap for ino_generation field. Fixes: 5c5e854bc760 ("perf tools: Add attr->mmap2 support") Signed-off-by: Jiri Olsa Acked-by: Namhyung Kim Link: https://lore.kernel.org/r/20201101233103

[PATCH 5.4 030/151] can: j1939: swap addr and pgn in the send example

2020-11-17 Thread Greg Kroah-Hartman
From: Yegor Yefremov [ Upstream commit ea780d39b1888ed5afc243c29b23d9bdb3828c7a ] The address was wrongly assigned to the PGN field and vice versa. Signed-off-by: Yegor Yefremov Link: https://lore.kernel.org/r/20201022083708.8755-1-yegorsli...@googlemail.com Fixes: 9d71dd0c7009 ("can: add

[PATCH 4.9 09/78] perf tools: Add missing swap for ino_generation

2020-11-17 Thread Greg Kroah-Hartman
From: Jiri Olsa [ Upstream commit fe01adb72356a4e2f8735e4128af85921ca98fa1 ] We are missing swap for ino_generation field. Fixes: 5c5e854bc760 ("perf tools: Add attr->mmap2 support") Signed-off-by: Jiri Olsa Acked-by: Namhyung Kim Link: https://lore.kernel.org/r/20201101233103

[PATCH 4.4 07/64] perf tools: Add missing swap for ino_generation

2020-11-17 Thread Greg Kroah-Hartman
From: Jiri Olsa [ Upstream commit fe01adb72356a4e2f8735e4128af85921ca98fa1 ] We are missing swap for ino_generation field. Fixes: 5c5e854bc760 ("perf tools: Add attr->mmap2 support") Signed-off-by: Jiri Olsa Acked-by: Namhyung Kim Link: https://lore.kernel.org/r/20201101233103

[PATCH 05/24] perf tools: Do not swap mmap2 fields in case it contains build id

2020-11-17 Thread Jiri Olsa
; }; struct { u8build_id[20]; u8build_id_size; u8__reserved_1; u16 __reserved_2; }; }; In this case we can't swap above fields. Signed-off-by: Jiri Olsa --- tools/perf/util/session.c

Re: [PATCH 1/6] ibmvfc: byte swap login_buf.resp values in attribute show functions

2020-11-16 Thread Martin K. Petersen
Tyrel, > The checkpatch script only warns at 100 char lines these days. To be > fair though I did have two lines go over that limit by a couple > characters, there are a couple commit log typos, and I had an if > keyword with no space after before the opening parenthesis. So, I'll > happily

Re: [PATCH v4 03/16] mm/swap: Optimise get_shadow_from_swap_cache

2020-11-14 Thread Christoph Hellwig
On Thu, Nov 12, 2020 at 09:26:28PM +, Matthew Wilcox (Oracle) wrote: > There's no need to get a reference to the page, just load the entry and > see if it's a shadow entry. > > Signed-off-by: Matthew Wilcox (Oracle) Looks good, Reviewed-by: Christoph Hellwig

Re: [PATCH 1/6] ibmvfc: byte swap login_buf.resp values in attribute show functions

2020-11-13 Thread Tyrel Datwyler
the VIOS and as such any multi-byte non-string values are in >> big endian format. >> >> Byte swap these values to host cpu endian format for better human >> readability. > > The whole series creates tons of pointlessly over 80 char lines. > Please do a quick fixu

[PATCH v4 03/16] mm/swap: Optimise get_shadow_from_swap_cache

2020-11-12 Thread Matthew Wilcox (Oracle)
There's no need to get a reference to the page, just load the entry and see if it's a shadow entry. Signed-off-by: Matthew Wilcox (Oracle) --- mm/swap_state.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/mm/swap_state.c b/mm/swap_state.c index

Re: [PATCH 1/6] ibmvfc: byte swap login_buf.resp values in attribute show functions

2020-11-12 Thread Christoph Hellwig
g endian format. > > Byte swap these values to host cpu endian format for better human > readability. The whole series creates tons of pointlessly over 80 char lines. Please do a quick fixup.

[PATCH 1/6] ibmvfc: byte swap login_buf.resp values in attribute show functions

2020-11-11 Thread Tyrel Datwyler
Both ibmvfc_show_host_(capabilities|npiv_version) functions retrieve values from vhost->login_buf.resp buffer. This is the MAD response buffer from the VIOS and as such any multi-byte non-string values are in big endian format. Byte swap these values to host cpu endian format for better hu

[PATCH 05/24] perf tools: Do not swap mmap2 fields in case it contains build id

2020-11-09 Thread Jiri Olsa
; }; struct { u8build_id[20]; u8build_id_size; u8__reserved_1; u16 __reserved_2; }; }; In this case we can't swap above fields. Signed-off-by: Jiri Olsa --- tools/perf/util/session.c

Re: Freezing between .48 and .51 when hitting swap.

2020-11-09 Thread Pavel Machek
On Fri 2020-10-30 04:17:07, NASA Jeff wrote: > I have an issue on my laptop which is old but with 2.5gb of ram an ssd hdd > and using zram compression I believe. > When ever it hits swap the system completely locks up and I have to reboot. > This only started occurring in .51 I'm a

Re: [REF PATCH] mm/swap: fix swapon failure

2020-11-09 Thread Alex Shi
在 2020/11/9 下午8:17, Alex Shi 写道: > > > 在 2020/11/9 下午8:07, Matthew Wilcox 写道: >> On Mon, Nov 09, 2020 at 07:47:16PM +0800, Alex Shi wrote: >>> Go through the context I found the exit_swap_address_space(p->type) >>> shouldn't be used in good result path. So just move it to error path. >> >>

Re: [REF PATCH] mm/swap: fix swapon failure

2020-11-09 Thread Alex Shi
在 2020/11/9 下午8:07, Matthew Wilcox 写道: > On Mon, Nov 09, 2020 at 07:47:16PM +0800, Alex Shi wrote: >> Go through the context I found the exit_swap_address_space(p->type) >> shouldn't be used in good result path. So just move it to error path. > > But ... it's not used in the success path.

Re: [REF PATCH] mm/swap: fix swapon failure

2020-11-09 Thread linmiaohe
Hi: Alex Shi wrote: > One of my VM guest has a swapon issue: > root #swapon -v -f /swap1 > swapon /swap1 > swapon: /swap1: found swap signature: version 1, page-size 4, same byte order > swapon: /swap1: pagesize=4096, swapsize=1607467008, devsize=1607467008 > swapon: /sw

Re: [REF PATCH] mm/swap: fix swapon failure

2020-11-09 Thread Matthew Wilcox
On Mon, Nov 09, 2020 at 07:47:16PM +0800, Alex Shi wrote: > Go through the context I found the exit_swap_address_space(p->type) > shouldn't be used in good result path. So just move it to error path. But ... it's not used in the success path. There's a 'goto' right before it. Does this really

[REF PATCH] mm/swap: fix swapon failure

2020-11-09 Thread Alex Shi
One of my VM guest has a swapon issue: root #swapon -v -f /swap1 swapon /swap1 swapon: /swap1: found swap signature: version 1, page-size 4, same byte order swapon: /swap1: pagesize=4096, swapsize=1607467008, devsize=1607467008 swapon: /swap1: swapon failed: Invalid argument and bisection report

Re: [PATCH] perf tools: Add missing swap for cgroup events

2020-11-03 Thread Arnaldo Carvalho de Melo
Em Mon, Nov 02, 2020 at 06:49:56PM +0100, Jiri Olsa escreveu: > On Mon, Nov 02, 2020 at 11:02:28PM +0900, Namhyung Kim wrote: > > It was missed to add a swap function for PERF_RECORD_CGROUP. > > > > Fixes: ba78c1c5461c ("perf tools: Basic support for CGROUP event&

Re: [PATCH] perf tools: Add missing swap for cgroup events

2020-11-02 Thread Jiri Olsa
On Mon, Nov 02, 2020 at 11:02:28PM +0900, Namhyung Kim wrote: > It was missed to add a swap function for PERF_RECORD_CGROUP. > > Fixes: ba78c1c5461c ("perf tools: Basic support for CGROUP event") Acked-by: Jiri Olsa thanks, jirka > Signed-off-by: Namhyung Kim &g

[PATCH] perf tools: Add missing swap for cgroup events

2020-11-02 Thread Namhyung Kim
It was missed to add a swap function for PERF_RECORD_CGROUP. Fixes: ba78c1c5461c ("perf tools: Basic support for CGROUP event") Signed-off-by: Namhyung Kim --- tools/perf/util/session.c | 13 + 1 file changed, 13 insertions(+) diff --git a/tools/perf/util/session.c b/

Re: [PATCH 2/2] perf tools: Add missing swap for ino_generation

2020-11-02 Thread Namhyung Kim
On Mon, Nov 2, 2020 at 8:31 AM Jiri Olsa wrote: > > We are missing swap for ino_generation field. > > Fixes: 5c5e854bc760 ("perf tools: Add attr->mmap2 support") > Signed-off-by: Jiri Olsa Acked-by: Namhyung Kim Thanks Namhyung > --- > tools/perf/util/se

[PATCH 1/2] mm/memcg: bail early from swap accounting if memcg disabled

2020-11-01 Thread Alex Shi
We could bail out early when memcg wasn't enabled. Signed-off-by: Alex Shi Reviewed-by: Roman Gushchin Acked-by: Michal Hocko Acked-by: Hugh Dickins Acked-by: Johannes Weiner Cc: Johannes Weiner Cc: Michal Hocko Cc: Vladimir Davydov Cc: Andrew Morton Cc: cgro...@vger.kernel.org Cc:

[PATCH 2/2] perf tools: Add missing swap for ino_generation

2020-11-01 Thread Jiri Olsa
We are missing swap for ino_generation field. Fixes: 5c5e854bc760 ("perf tools: Add attr->mmap2 support") Signed-off-by: Jiri Olsa --- tools/perf/util/session.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c index

One note on swap

2020-11-01 Thread NASA Jeff
Pages in active areas shouldn’t be swapped out only those in inactive areas. So it’s a bit like seminary rock. Networking may also have scheduling type issues. My script works well on single/duel CPU systems, for systems with larger numbers of CPUs I found checking /proc/stat for overall system

Freezing between .48 and .51 when hitting swap.

2020-11-01 Thread NASA Jeff
I have an issue on my laptop which is old but with 2.5gb of ram an ssd hdd and using zram compression I believe. When ever it hits swap the system completely locks up and I have to reboot. This only started occurring in .51 I only have access to my phone at the moment though I’ve looked

Freezing between .48 and .51 when hitting swap.

2020-11-01 Thread NASA Jeff
I have an issue on my laptop which is old but with 2.5gb of ram an ssd hdd and using zram compression I believe. When ever it hits swap the system completely locks up and I have to reboot. This only started occurring in .51 I only have access to my phone at the moment though I’ve looked

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

2020-10-30 Thread Alex Shi
在 2020/10/30 下午10:04, Johannes Weiner 写道: >>> Acked-by: Johannes Weiner >>> >>> This should go in before the previous patch that adds the WARN for it. >> Right, but than the long ops may not weird. Should I remove the ops and >> resend the whole patchset? > You mean the warning in the

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

2020-10-30 Thread Johannes Weiner
On Fri, Oct 30, 2020 at 10:27:51AM +0800, Alex Shi wrote: > > > 在 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 > >>

Freezing between .48 and .51 when hitting swap.

2020-10-29 Thread NASA Jeff
I have an issue on my laptop which is old but with 2.5gb of ram an ssd hdd and using zram compression I believe. When ever it hits swap the system completely locks up and I have to reboot. This only started occurring in .51 I only have access to my phone at the moment though I’ve looked

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