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

[PATCH -V9 15/21] swap: Support to move swap account for PMD swap mapping

2018-12-13 Thread Huang Ying
Previously the huge swap cluster will be split after the THP is swapout. Now, to support to swapin the THP in one piece, the huge swap cluster will not be split after the THP is reclaimed. So in memcg, we need to move the swap account for PMD swap mappings in the process's page table. When

[PATCH -V8 14/21] swap: Support to move swap account for PMD swap mapping

2018-12-06 Thread Huang Ying
Previously the huge swap cluster will be split after the THP is swapout. Now, to support to swapin the THP in one piece, the huge swap cluster will not be split after the THP is reclaimed. So in memcg, we need to move the swap account for PMD swap mappings in the process's page table. When

[PATCH -V8 14/21] swap: Support to move swap account for PMD swap mapping

2018-12-06 Thread Huang Ying
Previously the huge swap cluster will be split after the THP is swapout. Now, to support to swapin the THP in one piece, the huge swap cluster will not be split after the THP is reclaimed. So in memcg, we need to move the swap account for PMD swap mappings in the process's page table. When

[PATCH -V7 RESEND 14/21] swap: Support to move swap account for PMD swap mapping

2018-11-20 Thread Huang Ying
Previously the huge swap cluster will be split after the THP is swapout. Now, to support to swapin the THP in one piece, the huge swap cluster will not be split after the THP is reclaimed. So in memcg, we need to move the swap account for PMD swap mappings in the process's page table. When

[PATCH -V7 RESEND 14/21] swap: Support to move swap account for PMD swap mapping

2018-11-20 Thread Huang Ying
Previously the huge swap cluster will be split after the THP is swapout. Now, to support to swapin the THP in one piece, the huge swap cluster will not be split after the THP is reclaimed. So in memcg, we need to move the swap account for PMD swap mappings in the process's page table. When

Re: [PATCH -V6 14/21] swap: Support to move swap account for PMD swap mapping

2018-10-24 Thread Huang, Ying
Daniel Jordan writes: > On Wed, Oct 10, 2018 at 03:19:17PM +0800, Huang Ying wrote: >> +static struct page *mc_handle_swap_pmd(struct vm_area_struct *vma, >> +pmd_t pmd, swp_entry_t *entry) >> +{ > > Got > /home/dbbench/linux/mm/memcontrol.c:4719:21: warning:

Re: [PATCH -V6 14/21] swap: Support to move swap account for PMD swap mapping

2018-10-24 Thread Huang, Ying
Daniel Jordan writes: > On Wed, Oct 10, 2018 at 03:19:17PM +0800, Huang Ying wrote: >> +static struct page *mc_handle_swap_pmd(struct vm_area_struct *vma, >> +pmd_t pmd, swp_entry_t *entry) >> +{ > > Got > /home/dbbench/linux/mm/memcontrol.c:4719:21: warning:

Re: [PATCH -V6 14/21] swap: Support to move swap account for PMD swap mapping

2018-10-24 Thread Daniel Jordan
On Wed, Oct 10, 2018 at 03:19:17PM +0800, Huang Ying wrote: > +static struct page *mc_handle_swap_pmd(struct vm_area_struct *vma, > + pmd_t pmd, swp_entry_t *entry) > +{ Got /home/dbbench/linux/mm/memcontrol.c:4719:21: warning: ‘mc_handle_swap_pmd’ defined but not used

Re: [PATCH -V6 14/21] swap: Support to move swap account for PMD swap mapping

2018-10-24 Thread Daniel Jordan
On Wed, Oct 10, 2018 at 03:19:17PM +0800, Huang Ying wrote: > +static struct page *mc_handle_swap_pmd(struct vm_area_struct *vma, > + pmd_t pmd, swp_entry_t *entry) > +{ Got /home/dbbench/linux/mm/memcontrol.c:4719:21: warning: ‘mc_handle_swap_pmd’ defined but not used

[PATCH -V6 14/21] swap: Support to move swap account for PMD swap mapping

2018-10-10 Thread Huang Ying
Previously the huge swap cluster will be split after the THP is swapout. Now, to support to swapin the THP in one piece, the huge swap cluster will not be split after the THP is reclaimed. So in memcg, we need to move the swap account for PMD swap mappings in the process's page table. When

[PATCH -V6 14/21] swap: Support to move swap account for PMD swap mapping

2018-10-10 Thread Huang Ying
Previously the huge swap cluster will be split after the THP is swapout. Now, to support to swapin the THP in one piece, the huge swap cluster will not be split after the THP is reclaimed. So in memcg, we need to move the swap account for PMD swap mappings in the process's page table. When

[PATCH -V5 RESEND 14/21] swap: Support to move swap account for PMD swap mapping

2018-09-25 Thread Huang Ying
Previously the huge swap cluster will be split after the THP is swapout. Now, to support to swapin the THP in one piece, the huge swap cluster will not be split after the THP is reclaimed. So in memcg, we need to move the swap account for PMD swap mappings in the process's page table. When

[PATCH -V5 RESEND 14/21] swap: Support to move swap account for PMD swap mapping

2018-09-25 Thread Huang Ying
Previously the huge swap cluster will be split after the THP is swapout. Now, to support to swapin the THP in one piece, the huge swap cluster will not be split after the THP is reclaimed. So in memcg, we need to move the swap account for PMD swap mappings in the process's page table. When

[PATCH -V5 RESEND 14/21] swap: Support to move swap account for PMD swap mapping

2018-09-11 Thread Huang Ying
Previously the huge swap cluster will be split after the THP is swapout. Now, to support to swapin the THP in one piece, the huge swap cluster will not be split after the THP is reclaimed. So in memcg, we need to move the swap account for PMD swap mappings in the process's page table. When

[PATCH -V5 RESEND 14/21] swap: Support to move swap account for PMD swap mapping

2018-09-11 Thread Huang Ying
Previously the huge swap cluster will be split after the THP is swapout. Now, to support to swapin the THP in one piece, the huge swap cluster will not be split after the THP is reclaimed. So in memcg, we need to move the swap account for PMD swap mappings in the process's page table. When

[PATCH -V5 14/21] swap: Support to move swap account for PMD swap mapping

2018-09-03 Thread Huang Ying
Previously the huge swap cluster will be split after the THP is swapout. Now, to support to swapin the THP in one piece, the huge swap cluster will not be split after the THP is reclaimed. So in memcg, we need to move the swap account for PMD swap mappings in the process's page table. When

[PATCH -V5 14/21] swap: Support to move swap account for PMD swap mapping

2018-09-03 Thread Huang Ying
Previously the huge swap cluster will be split after the THP is swapout. Now, to support to swapin the THP in one piece, the huge swap cluster will not be split after the THP is reclaimed. So in memcg, we need to move the swap account for PMD swap mappings in the process's page table. When

Re: [PATCH -mm -v4 14/21] mm, cgroup, THP, swap: Support to move swap account for PMD swap mapping

2018-07-10 Thread Daniel Jordan
On Tue, Jul 10, 2018 at 03:49:58PM +0800, Huang, Ying wrote: > Daniel Jordan writes: > > > On Fri, Jun 22, 2018 at 11:51:44AM +0800, Huang, Ying wrote: > >> Because there is no way to prevent a huge swap cluster from being > >> split except when it has SWAP_HAS_CACH

Re: [PATCH -mm -v4 14/21] mm, cgroup, THP, swap: Support to move swap account for PMD swap mapping

2018-07-10 Thread Daniel Jordan
On Tue, Jul 10, 2018 at 03:49:58PM +0800, Huang, Ying wrote: > Daniel Jordan writes: > > > On Fri, Jun 22, 2018 at 11:51:44AM +0800, Huang, Ying wrote: > >> Because there is no way to prevent a huge swap cluster from being > >> split except when it has SWAP_HAS_CACH

Re: [PATCH -mm -v4 14/21] mm, cgroup, THP, swap: Support to move swap account for PMD swap mapping

2018-07-10 Thread Huang, Ying
Daniel Jordan writes: > On Fri, Jun 22, 2018 at 11:51:44AM +0800, Huang, Ying wrote: >> Because there is no way to prevent a huge swap cluster from being >> split except when it has SWAP_HAS_CACHE flag set. > > What about making get_mctgt_type_thp take the cluster lock?

Re: [PATCH -mm -v4 14/21] mm, cgroup, THP, swap: Support to move swap account for PMD swap mapping

2018-07-10 Thread Huang, Ying
Daniel Jordan writes: > On Fri, Jun 22, 2018 at 11:51:44AM +0800, Huang, Ying wrote: >> Because there is no way to prevent a huge swap cluster from being >> split except when it has SWAP_HAS_CACHE flag set. > > What about making get_mctgt_type_thp take the cluster lock?

Re: [PATCH -mm -v4 14/21] mm, cgroup, THP, swap: Support to move swap account for PMD swap mapping

2018-07-09 Thread Daniel Jordan
On Fri, Jun 22, 2018 at 11:51:44AM +0800, Huang, Ying wrote: > Because there is no way to prevent a huge swap cluster from being > split except when it has SWAP_HAS_CACHE flag set. What about making get_mctgt_type_thp take the cluster lock? That function would be the first lock_cluste

Re: [PATCH -mm -v4 14/21] mm, cgroup, THP, swap: Support to move swap account for PMD swap mapping

2018-07-09 Thread Daniel Jordan
On Fri, Jun 22, 2018 at 11:51:44AM +0800, Huang, Ying wrote: > Because there is no way to prevent a huge swap cluster from being > split except when it has SWAP_HAS_CACHE flag set. What about making get_mctgt_type_thp take the cluster lock? That function would be the first lock_cluste

[PATCH -mm -v4 14/21] mm, cgroup, THP, swap: Support to move swap account for PMD swap mapping

2018-06-21 Thread Huang, Ying
From: Huang Ying Previously the huge swap cluster will be split after the THP is swapout. Now, to support to swapin the THP as a whole, the huge swap cluster will not be split after the THP is reclaimed. So in memcg, we need to move the swap account for PMD swap mappings in the process's page

[PATCH -mm -v4 14/21] mm, cgroup, THP, swap: Support to move swap account for PMD swap mapping

2018-06-21 Thread Huang, Ying
From: Huang Ying Previously the huge swap cluster will be split after the THP is swapout. Now, to support to swapin the THP as a whole, the huge swap cluster will not be split after the THP is reclaimed. So in memcg, we need to move the swap account for PMD swap mappings in the process's page

[PATCH -mm -V3 14/21] mm, cgroup, THP, swap: Support to move swap account for PMD swap mapping

2018-05-23 Thread Huang, Ying
From: Huang Ying <ying.hu...@intel.com> Previously the huge swap cluster will be split after the THP is swapout. Now, to support to swapin the THP as a whole, the huge swap cluster will not be split after the THP is reclaimed. So in memcg, we need to move the swap account for PMD swap ma

[PATCH -mm -V3 14/21] mm, cgroup, THP, swap: Support to move swap account for PMD swap mapping

2018-05-23 Thread Huang, Ying
From: Huang Ying Previously the huge swap cluster will be split after the THP is swapout. Now, to support to swapin the THP as a whole, the huge swap cluster will not be split after the THP is reclaimed. So in memcg, we need to move the swap account for PMD swap mappings in the process's page

[PATCH -mm -V2 14/21] mm, cgroup, THP, swap: Support to move swap account for PMD swap mapping

2018-05-09 Thread Huang, Ying
From: Huang Ying <ying.hu...@intel.com> Previously the huge swap cluster will be split after the THP is swapout. Now, to support to swapin the THP as a whole, the huge swap cluster will not be split after the THP is reclaimed. So in memcg, we need to move the swap account for PMD swap ma

[PATCH -mm -V2 14/21] mm, cgroup, THP, swap: Support to move swap account for PMD swap mapping

2018-05-09 Thread Huang, Ying
From: Huang Ying Previously the huge swap cluster will be split after the THP is swapout. Now, to support to swapin the THP as a whole, the huge swap cluster will not be split after the THP is reclaimed. So in memcg, we need to move the swap account for PMD swap mappings in the process's page

[PATCH -mm 14/21] mm, cgroup, THP, swap: Support to move swap account for PMD swap mapping

2018-04-16 Thread Huang, Ying
From: Huang Ying <ying.hu...@intel.com> Previously the huge swap cluster will be split after the THP is swapout. Now, to support to swapin the THP as a whole, the huge swap cluster will not be split after the THP is reclaimed. So in memcg, we need to move the swap account for PMD swap ma

[PATCH -mm 14/21] mm, cgroup, THP, swap: Support to move swap account for PMD swap mapping

2018-04-16 Thread Huang, Ying
From: Huang Ying Previously the huge swap cluster will be split after the THP is swapout. Now, to support to swapin the THP as a whole, the huge swap cluster will not be split after the THP is reclaimed. So in memcg, we need to move the swap account for PMD swap mappings in the process's page

[PATCH 4.15 29/64] mm, swap, frontswap: fix THP swap if frontswap enabled

2018-02-26 Thread Greg Kroah-Hartman
p (via zswap) are both enabled, when memory goes low so that swap is triggered, segfault and memory corruption will occur in random user space applications as follow, kernel: urxvt[338]: segfault at 20 ip 7fc08889ae0d sp 7ffc73a7fc40 error 6 in libc-2.26.so[7fc08881a000+1ae00

[PATCH 4.15 29/64] mm, swap, frontswap: fix THP swap if frontswap enabled

2018-02-26 Thread Greg Kroah-Hartman
memory goes low so that swap is triggered, segfault and memory corruption will occur in random user space applications as follow, kernel: urxvt[338]: segfault at 20 ip 7fc08889ae0d sp 7ffc73a7fc40 error 6 in libc-2.26.so[7fc08881a000+1ae000] #0 0x7fc08889ae0d _int_malloc (libc.so.6

[PATCH 4.14 27/54] mm, swap, frontswap: fix THP swap if frontswap enabled

2018-02-26 Thread Greg Kroah-Hartman
p (via zswap) are both enabled, when memory goes low so that swap is triggered, segfault and memory corruption will occur in random user space applications as follow, kernel: urxvt[338]: segfault at 20 ip 7fc08889ae0d sp 7ffc73a7fc40 error 6 in libc-2.26.so[7fc08881a000+1ae00

[PATCH 4.14 27/54] mm, swap, frontswap: fix THP swap if frontswap enabled

2018-02-26 Thread Greg Kroah-Hartman
memory goes low so that swap is triggered, segfault and memory corruption will occur in random user space applications as follow, kernel: urxvt[338]: segfault at 20 ip 7fc08889ae0d sp 7ffc73a7fc40 error 6 in libc-2.26.so[7fc08881a000+1ae000] #0 0x7fc08889ae0d _int_malloc (libc.so.6

Re: [PATCH -mm -v2] mm, swap, frontswap: Fix THP swap if frontswap enabled

2018-02-12 Thread Dan Streetman
gt; > > > > > It was reported by Sergey Senozhatsky that if THP (Transparent Huge > > > Page) and frontswap (via zswap) are both enabled, when memory goes low > > > so that swap is triggered, segfault and memory corruption will occur > > > in random use

Re: [PATCH -mm -v2] mm, swap, frontswap: Fix THP swap if frontswap enabled

2018-02-12 Thread Dan Streetman
y that if THP (Transparent Huge > > > Page) and frontswap (via zswap) are both enabled, when memory goes low > > > so that swap is triggered, segfault and memory corruption will occur > > > in random user space applications as follow, > > > > > > kernel: urxvt[338]

Re: [PATCH -mm -v3] mm, swap, frontswap: Fix THP swap if frontswap enabled

2018-02-11 Thread Sergey Senozhatsky
s: bd4c82c22c367e068 ("mm, THP, swap: delay splitting THP after swapped > > out") > > Reported-by: Sergey Senozhatsky <sergey.senozhat...@gmail.com> > > Tested-by: Sergey Senozhatsky <sergey.senozhat...@gmail.com> > > I don't think Sergey has tested thi

Re: [PATCH -mm -v3] mm, swap, frontswap: Fix THP swap if frontswap enabled

2018-02-11 Thread Sergey Senozhatsky
s: bd4c82c22c367e068 ("mm, THP, swap: delay splitting THP after swapped > > out") > > Reported-by: Sergey Senozhatsky > > Tested-by: Sergey Senozhatsky > > I don't think Sergey has tested this version and I suspect this is a > holdover from the earlier patch, so

Re: [PATCH -mm -v3] mm, swap, frontswap: Fix THP swap if frontswap enabled

2018-02-09 Thread Andrew Morton
On Fri, 9 Feb 2018 16:49:47 +0800 "Huang, Ying" <ying.hu...@intel.com> wrote: > From: Huang Ying <huang.ying.cari...@gmail.com> > > It was reported by Sergey Senozhatsky that if THP (Transparent Huge > Page) and frontswap (via zswap) are both enabled, w

Re: [PATCH -mm -v3] mm, swap, frontswap: Fix THP swap if frontswap enabled

2018-02-09 Thread Andrew Morton
On Fri, 9 Feb 2018 16:49:47 +0800 "Huang, Ying" wrote: > From: Huang Ying > > It was reported by Sergey Senozhatsky that if THP (Transparent Huge > Page) and frontswap (via zswap) are both enabled, when memory goes low > so that swap is triggered, segfault and mem

[PATCH -mm -v3] mm, swap, frontswap: Fix THP swap if frontswap enabled

2018-02-09 Thread Huang, Ying
From: Huang Ying <huang.ying.cari...@gmail.com> It was reported by Sergey Senozhatsky that if THP (Transparent Huge Page) and frontswap (via zswap) are both enabled, when memory goes low so that swap is triggered, segfault and memory corruption will occur in random user space applic

[PATCH -mm -v3] mm, swap, frontswap: Fix THP swap if frontswap enabled

2018-02-09 Thread Huang, Ying
From: Huang Ying It was reported by Sergey Senozhatsky that if THP (Transparent Huge Page) and frontswap (via zswap) are both enabled, when memory goes low so that swap is triggered, segfault and memory corruption will occur in random user space applications as follow, kernel: urxvt[338

Re: [PATCH -mm -v2] mm, swap, frontswap: Fix THP swap if frontswap enabled

2018-02-08 Thread Huang, Ying
gt; > >> > It was reported by Sergey Senozhatsky that if THP (Transparent Huge >> > Page) and frontswap (via zswap) are both enabled, when memory goes low >> > so that swap is triggered, segfault and memory corruption will occur >> > in random user space appl

Re: [PATCH -mm -v2] mm, swap, frontswap: Fix THP swap if frontswap enabled

2018-02-08 Thread Huang, Ying
t Huge >> > Page) and frontswap (via zswap) are both enabled, when memory goes low >> > so that swap is triggered, segfault and memory corruption will occur >> > in random user space applications as follow, >> > >> > kernel: urxvt[338]: segfault at 20 ip 7fc08

Re: [PATCH -mm -v2] mm, swap, frontswap: Fix THP swap if frontswap enabled

2018-02-08 Thread Minchan Kim
rent Huge > > Page) and frontswap (via zswap) are both enabled, when memory goes low > > so that swap is triggered, segfault and memory corruption will occur > > in random user space applications as follow, > > > > kernel: urxvt[338]: segfault at 20 ip 7fc08889ae0

Re: [PATCH -mm -v2] mm, swap, frontswap: Fix THP swap if frontswap enabled

2018-02-08 Thread Minchan Kim
abled, when memory goes low > > so that swap is triggered, segfault and memory corruption will occur > > in random user space applications as follow, > > > > kernel: urxvt[338]: segfault at 20 ip 7fc08889ae0d sp 7ffc73a7fc40 > > error 6 in libc-2.26.so[7fc

Re: [PATCH -mm -v2] mm, swap, frontswap: Fix THP swap if frontswap enabled

2018-02-08 Thread huang ying
On Wed, Feb 7, 2018 at 3:00 PM, Huang, Ying <ying.hu...@intel.com> wrote: > From: Huang Ying <huang.ying.cari...@gmail.com> > > It was reported by Sergey Senozhatsky that if THP (Transparent Huge > Page) and frontswap (via zswap) are both enabled, when memory goes low >

Re: [PATCH -mm -v2] mm, swap, frontswap: Fix THP swap if frontswap enabled

2018-02-08 Thread huang ying
On Wed, Feb 7, 2018 at 3:00 PM, Huang, Ying wrote: > From: Huang Ying > > It was reported by Sergey Senozhatsky that if THP (Transparent Huge > Page) and frontswap (via zswap) are both enabled, when memory goes low > so that swap is triggered, segfault and memory corrup

Re: [PATCH -mm -v2] mm, swap, frontswap: Fix THP swap if frontswap enabled

2018-02-08 Thread huang ying
>> Page) and frontswap (via zswap) are both enabled, when memory goes low >> so that swap is triggered, segfault and memory corruption will occur >> in random user space applications as follow, >> >> kernel: urxvt[338]: segfault at 20 ip 7fc08889ae0d sp 7ffc7

Re: [PATCH -mm -v2] mm, swap, frontswap: Fix THP swap if frontswap enabled

2018-02-08 Thread huang ying
when memory goes low >> so that swap is triggered, segfault and memory corruption will occur >> in random user space applications as follow, >> >> kernel: urxvt[338]: segfault at 20 ip 7fc08889ae0d sp 7ffc73a7fc40 >> error 6 in libc-2.26.so[7fc08881a000+1ae000]

Re: [PATCH -mm -v2] mm, swap, frontswap: Fix THP swap if frontswap enabled

2018-02-08 Thread Sergey Senozhatsky
On (02/08/18 02:25), Minchan Kim wrote: [..] > > > if (PageTransHuge(page)) { > > > - if (IS_ENABLED(CONFIG_THP_SWAP)) > > > - get_swap_pages(1, true, ); > > > + /* Frontswap doesn't support THP */ > > > + if (!frontswap_enabled()) { > > > +

Re: [PATCH -mm -v2] mm, swap, frontswap: Fix THP swap if frontswap enabled

2018-02-08 Thread Sergey Senozhatsky
On (02/08/18 02:25), Minchan Kim wrote: [..] > > > if (PageTransHuge(page)) { > > > - if (IS_ENABLED(CONFIG_THP_SWAP)) > > > - get_swap_pages(1, true, ); > > > + /* Frontswap doesn't support THP */ > > > + if (!frontswap_enabled()) { > > > +

Re: [PATCH -mm -v2] mm, swap, frontswap: Fix THP swap if frontswap enabled

2018-02-08 Thread Minchan Kim
On Thu, Feb 08, 2018 at 10:36:35AM +0900, Sergey Senozhatsky wrote: > On (02/07/18 13:05), Andrew Morton wrote: > [..] > > hm. This is assuming that "cluster==true" means "this is thp swap". > > That's presently true, but is it appropriate that get_s

Re: [PATCH -mm -v2] mm, swap, frontswap: Fix THP swap if frontswap enabled

2018-02-08 Thread Minchan Kim
On Thu, Feb 08, 2018 at 10:36:35AM +0900, Sergey Senozhatsky wrote: > On (02/07/18 13:05), Andrew Morton wrote: > [..] > > hm. This is assuming that "cluster==true" means "this is thp swap". > > That's presently true, but is it appropriate that get_s

Re: [PATCH -mm -v2] mm, swap, frontswap: Fix THP swap if frontswap enabled

2018-02-08 Thread Minchan Kim
On Wed, Feb 07, 2018 at 03:00:35PM +0800, Huang, Ying wrote: > From: Huang Ying <huang.ying.cari...@gmail.com> > > It was reported by Sergey Senozhatsky that if THP (Transparent Huge > Page) and frontswap (via zswap) are both enabled, when memory goes low > so that swap i

Re: [PATCH -mm -v2] mm, swap, frontswap: Fix THP swap if frontswap enabled

2018-02-08 Thread Minchan Kim
On Wed, Feb 07, 2018 at 03:00:35PM +0800, Huang, Ying wrote: > From: Huang Ying > > It was reported by Sergey Senozhatsky that if THP (Transparent Huge > Page) and frontswap (via zswap) are both enabled, when memory goes low > so that swap is triggered, segfault and memory corrup

Re: [PATCH -mm -v2] mm, swap, frontswap: Fix THP swap if frontswap enabled

2018-02-07 Thread Sergey Senozhatsky
On (02/07/18 13:05), Andrew Morton wrote: [..] > hm. This is assuming that "cluster==true" means "this is thp swap". > That's presently true, but is it appropriate that get_swap_pages() is > peeking at "cluster" to work out why it is being ca

Re: [PATCH -mm -v2] mm, swap, frontswap: Fix THP swap if frontswap enabled

2018-02-07 Thread Sergey Senozhatsky
On (02/07/18 13:05), Andrew Morton wrote: [..] > hm. This is assuming that "cluster==true" means "this is thp swap". > That's presently true, but is it appropriate that get_swap_pages() is > peeking at "cluster" to work out why it is being ca

Re: [PATCH -mm -v2] mm, swap, frontswap: Fix THP swap if frontswap enabled

2018-02-07 Thread Huang, Ying
(Transparent Huge >> Page) and frontswap (via zswap) are both enabled, when memory goes low >> so that swap is triggered, segfault and memory corruption will occur >> in random user space applications as follow, >> >> kernel: urxvt[338]: segfault at 20 ip 7fc088

Re: [PATCH -mm -v2] mm, swap, frontswap: Fix THP swap if frontswap enabled

2018-02-07 Thread Huang, Ying
Andrew Morton writes: > On Wed, 7 Feb 2018 15:00:35 +0800 "Huang, Ying" wrote: > >> From: Huang Ying >> >> It was reported by Sergey Senozhatsky that if THP (Transparent Huge >> Page) and frontswap (via zswap) are both enabled, when memory goes lo

Re: [PATCH -mm -v2] mm, swap, frontswap: Fix THP swap if frontswap enabled

2018-02-07 Thread Andrew Morton
On Wed, 7 Feb 2018 15:00:35 +0800 "Huang, Ying" <ying.hu...@intel.com> wrote: > From: Huang Ying <huang.ying.cari...@gmail.com> > > It was reported by Sergey Senozhatsky that if THP (Transparent Huge > Page) and frontswap (via zswap) are both enabled, w

Re: [PATCH -mm -v2] mm, swap, frontswap: Fix THP swap if frontswap enabled

2018-02-07 Thread Andrew Morton
On Wed, 7 Feb 2018 15:00:35 +0800 "Huang, Ying" wrote: > From: Huang Ying > > It was reported by Sergey Senozhatsky that if THP (Transparent Huge > Page) and frontswap (via zswap) are both enabled, when memory goes low > so that swap is triggered, segfault and mem

Re: [PATCH -mm -v2] mm, swap, frontswap: Fix THP swap if frontswap enabled

2018-02-07 Thread Konrad Rzeszutek Wilk
On Wed, Feb 07, 2018 at 03:00:35PM +0800, Huang, Ying wrote: > From: Huang Ying <huang.ying.cari...@gmail.com> > > It was reported by Sergey Senozhatsky that if THP (Transparent Huge > Page) and frontswap (via zswap) are both enabled, when memory goes low > so that swap i

Re: [PATCH -mm -v2] mm, swap, frontswap: Fix THP swap if frontswap enabled

2018-02-07 Thread Konrad Rzeszutek Wilk
On Wed, Feb 07, 2018 at 03:00:35PM +0800, Huang, Ying wrote: > From: Huang Ying > > It was reported by Sergey Senozhatsky that if THP (Transparent Huge > Page) and frontswap (via zswap) are both enabled, when memory goes low > so that swap is triggered, segfault and memory corrup

[PATCH -mm -v2] mm, swap, frontswap: Fix THP swap if frontswap enabled

2018-02-06 Thread Huang, Ying
From: Huang Ying <huang.ying.cari...@gmail.com> It was reported by Sergey Senozhatsky that if THP (Transparent Huge Page) and frontswap (via zswap) are both enabled, when memory goes low so that swap is triggered, segfault and memory corruption will occur in random user space applic

[PATCH -mm -v2] mm, swap, frontswap: Fix THP swap if frontswap enabled

2018-02-06 Thread Huang, Ying
From: Huang Ying It was reported by Sergey Senozhatsky that if THP (Transparent Huge Page) and frontswap (via zswap) are both enabled, when memory goes low so that swap is triggered, segfault and memory corruption will occur in random user space applications as follow, kernel: urxvt[338

Re: [PATCH -mm] mm, swap, frontswap: Fix THP swap if frontswap enabled

2018-02-06 Thread Huang, Ying
lt;ying.hu...@intel.com> >> >> >> >> >> >> It was reported by Sergey Senozhatsky that if THP (Transparent Huge >> >> >> Page) and frontswap (via zswap) are both enabled, when memory goes low >> >> >> so that swap is triggere

Re: [PATCH -mm] mm, swap, frontswap: Fix THP swap if frontswap enabled

2018-02-06 Thread Huang, Ying
; >> Minchan Kim writes: >> >> >> >> > Hi Huang, >> >> > >> >> > On Tue, Feb 06, 2018 at 02:54:04PM +0800, Huang, Ying wrote: >> >> >> From: Huang Ying >> >> >> >> >> >> It was reported by Sergey S

Re: [PATCH -mm] mm, swap, frontswap: Fix THP swap if frontswap enabled

2018-02-06 Thread Minchan Kim
c...@kernel.org> writes: > >> > >> > Hi Huang, > >> > > >> > On Tue, Feb 06, 2018 at 02:54:04PM +0800, Huang, Ying wrote: > >> >> From: Huang Ying <ying.hu...@intel.com> > >> >> > >> >> It was reported by Serg

Re: [PATCH -mm] mm, swap, frontswap: Fix THP swap if frontswap enabled

2018-02-06 Thread Minchan Kim
i Huang, > >> > > >> > On Tue, Feb 06, 2018 at 02:54:04PM +0800, Huang, Ying wrote: > >> >> From: Huang Ying > >> >> > >> >> It was reported by Sergey Senozhatsky that if THP (Transparent Huge > >> >> Page)

Re: [PATCH -mm] mm, swap, frontswap: Fix THP swap if frontswap enabled

2018-02-06 Thread Minchan Kim
Hi Sergey, On Tue, Feb 06, 2018 at 06:48:22PM +0900, Sergey Senozhatsky wrote: > Hello, > > On (02/06/18 01:02), Minchan Kim wrote: > [..] > > Can't we simple do like that if you want to make it simple and rely on > > someone > > who makes frontswap THP-aware later? > > > > diff --git

Re: [PATCH -mm] mm, swap, frontswap: Fix THP swap if frontswap enabled

2018-02-06 Thread Minchan Kim
Hi Sergey, On Tue, Feb 06, 2018 at 06:48:22PM +0900, Sergey Senozhatsky wrote: > Hello, > > On (02/06/18 01:02), Minchan Kim wrote: > [..] > > Can't we simple do like that if you want to make it simple and rely on > > someone > > who makes frontswap THP-aware later? > > > > diff --git

Re: [PATCH -mm] mm, swap, frontswap: Fix THP swap if frontswap enabled

2018-02-06 Thread huang ying
e, Feb 06, 2018 at 02:54:04PM +0800, Huang, Ying wrote: >> >> From: Huang Ying <ying.hu...@intel.com> >> >> >> >> It was reported by Sergey Senozhatsky that if THP (Transparent Huge >> >> Page) and frontswap (via zswap) are both enabled, wh

Re: [PATCH -mm] mm, swap, frontswap: Fix THP swap if frontswap enabled

2018-02-06 Thread huang ying
e: >> >> From: Huang Ying >> >> >> >> It was reported by Sergey Senozhatsky that if THP (Transparent Huge >> >> Page) and frontswap (via zswap) are both enabled, when memory goes low >> >> so that swap is triggered, segfault and memory

Re: [PATCH -mm] mm, swap, frontswap: Fix THP swap if frontswap enabled

2018-02-06 Thread Sergey Senozhatsky
Hello, On (02/06/18 01:02), Minchan Kim wrote: [..] > Can't we simple do like that if you want to make it simple and rely on someone > who makes frontswap THP-aware later? > > diff --git a/mm/swapfile.c b/mm/swapfile.c > index 42fe5653814a..4bf1725407aa 100644 > --- a/mm/swapfile.c > +++

Re: [PATCH -mm] mm, swap, frontswap: Fix THP swap if frontswap enabled

2018-02-06 Thread Sergey Senozhatsky
Hello, On (02/06/18 01:02), Minchan Kim wrote: [..] > Can't we simple do like that if you want to make it simple and rely on someone > who makes frontswap THP-aware later? > > diff --git a/mm/swapfile.c b/mm/swapfile.c > index 42fe5653814a..4bf1725407aa 100644 > --- a/mm/swapfile.c > +++

Re: [PATCH -mm] mm, swap, frontswap: Fix THP swap if frontswap enabled

2018-02-06 Thread Minchan Kim
@intel.com> > >> > >> It was reported by Sergey Senozhatsky that if THP (Transparent Huge > >> Page) and frontswap (via zswap) are both enabled, when memory goes low > >> so that swap is triggered, segfault and memory corruption will occur > >> in random user

Re: [PATCH -mm] mm, swap, frontswap: Fix THP swap if frontswap enabled

2018-02-06 Thread Minchan Kim
orted by Sergey Senozhatsky that if THP (Transparent Huge > >> Page) and frontswap (via zswap) are both enabled, when memory goes low > >> so that swap is triggered, segfault and memory corruption will occur > >> in random user space applications as follow, > >> > >

Re: [PATCH -mm] mm, swap, frontswap: Fix THP swap if frontswap enabled

2018-02-06 Thread Huang, Ying
> Page) and frontswap (via zswap) are both enabled, when memory goes low >> so that swap is triggered, segfault and memory corruption will occur >> in random user space applications as follow, >> >> kernel: urxvt[338]: segfault at 20 ip 7fc08889ae0d sp 000

Re: [PATCH -mm] mm, swap, frontswap: Fix THP swap if frontswap enabled

2018-02-06 Thread Huang, Ying
Hi, Minchan, Minchan Kim writes: > Hi Huang, > > On Tue, Feb 06, 2018 at 02:54:04PM +0800, Huang, Ying wrote: >> From: Huang Ying >> >> It was reported by Sergey Senozhatsky that if THP (Transparent Huge >> Page) and frontswap (via zswap) are both enabled, whe

Re: [PATCH -mm] mm, swap, frontswap: Fix THP swap if frontswap enabled

2018-02-06 Thread Minchan Kim
Hi Huang, On Tue, Feb 06, 2018 at 02:54:04PM +0800, Huang, Ying wrote: > From: Huang Ying <ying.hu...@intel.com> > > It was reported by Sergey Senozhatsky that if THP (Transparent Huge > Page) and frontswap (via zswap) are both enabled, when memory goes low > so that swap i

Re: [PATCH -mm] mm, swap, frontswap: Fix THP swap if frontswap enabled

2018-02-06 Thread Minchan Kim
Hi Huang, On Tue, Feb 06, 2018 at 02:54:04PM +0800, Huang, Ying wrote: > From: Huang Ying > > It was reported by Sergey Senozhatsky that if THP (Transparent Huge > Page) and frontswap (via zswap) are both enabled, when memory goes low > so that swap is triggered, segfault and me

[PATCH -mm] mm, swap, frontswap: Fix THP swap if frontswap enabled

2018-02-05 Thread Huang, Ying
From: Huang Ying <ying.hu...@intel.com> It was reported by Sergey Senozhatsky that if THP (Transparent Huge Page) and frontswap (via zswap) are both enabled, when memory goes low so that swap is triggered, segfault and memory corruption will occur in random user space applications as

[PATCH -mm] mm, swap, frontswap: Fix THP swap if frontswap enabled

2018-02-05 Thread Huang, Ying
From: Huang Ying It was reported by Sergey Senozhatsky that if THP (Transparent Huge Page) and frontswap (via zswap) are both enabled, when memory goes low so that swap is triggered, segfault and memory corruption will occur in random user space applications as follow, kernel: urxvt[338

[PATCH 4.13 22/36] mm, swap: fix race between swap count continuation operations

2017-11-06 Thread Greg Kroah-Hartman
in multiple swap clusters. If some of the entries has sis->swap_map[offset] > SWAP_MAP_MAX, multiple pages will be used to store the set of entries of the sis->swap_map. And the pages are linked with page->lru. This is called swap count continuation. To access the pages which

[PATCH 4.13 22/36] mm, swap: fix race between swap count continuation operations

2017-11-06 Thread Greg Kroah-Hartman
4.13-stable review patch. If anyone has any objections, please let me know. -- From: Huang Ying commit 2628bd6fc052bd85e9864dae4de494d8a6313391 upstream. One page may store a set of entries of the sis->swap_map (swap_info_struct->swap_map) in multiple swap clusters. I

Re: [PATCH] mm: try to free swap only for reading swap fault

2017-11-02 Thread zhouxianrong
i mean for reading swap fault try_to_free_swap in do_swap_page could hurt clean swap cache pages and make them dirty. it affects reclaim procedure in shrink_page_list and let this function write out much more these dirty anonymous pages. in fact these dirty anonymous pages might keep clean

Re: [PATCH] mm: try to free swap only for reading swap fault

2017-11-02 Thread zhouxianrong
i mean for reading swap fault try_to_free_swap in do_swap_page could hurt clean swap cache pages and make them dirty. it affects reclaim procedure in shrink_page_list and let this function write out much more these dirty anonymous pages. in fact these dirty anonymous pages might keep clean

Re: [PATCH] mm: try to free swap only for reading swap fault

2017-11-02 Thread Michal Hocko
On Thu 02-11-17 20:35:19, zhouxianr...@huawei.com wrote: > From: zhouxianrong <zhouxianr...@huawei.com> > > the purpose of this patch is that when a reading swap fault > happens on a clean swap cache page whose swap count is equal > to one, then try_to_free_swap could

Re: [PATCH] mm: try to free swap only for reading swap fault

2017-11-02 Thread Michal Hocko
On Thu 02-11-17 20:35:19, zhouxianr...@huawei.com wrote: > From: zhouxianrong > > the purpose of this patch is that when a reading swap fault > happens on a clean swap cache page whose swap count is equal > to one, then try_to_free_swap could remove this page from > s

[PATCH] mm: try to free swap only for reading swap fault

2017-11-02 Thread zhouxianrong
From: zhouxianrong <zhouxianr...@huawei.com> the purpose of this patch is that when a reading swap fault happens on a clean swap cache page whose swap count is equal to one, then try_to_free_swap could remove this page from swap cache and mark this page dirty. so if later we reclaimed thi

[PATCH] mm: try to free swap only for reading swap fault

2017-11-02 Thread zhouxianrong
From: zhouxianrong the purpose of this patch is that when a reading swap fault happens on a clean swap cache page whose swap count is equal to one, then try_to_free_swap could remove this page from swap cache and mark this page dirty. so if later we reclaimed this page then we could pageout

[PATCH -mm -V2] mm, swap: Fix race between swap count continuation operations

2017-10-19 Thread Huang, Ying
From: Huang Ying <ying.hu...@intel.com> One page may store a set of entries of the sis->swap_map (swap_info_struct->swap_map) in multiple swap clusters. If some of the entries has sis->swap_map[offset] > SWAP_MAP_MAX, multiple pages will be used to store the set of entries of

  1   2   3   >