Re: [PATCH v3] mm/page_owner: use kvmalloc instead of kmalloc

2018-11-01 Thread Michal Hocko
On Thu 01-11-18 18:00:12, Miles Chen wrote: [...] > I did a test today, the only code changed is to clamp to read count to > PAGE_SIZE and it worked well. Maybe we can solve this issue by just > clamping the read count. > > count = count > PAGE_SIZE ? PAGE_SIZE : count; This i what Matthew was

Re: [PATCH v3] mm/page_owner: use kvmalloc instead of kmalloc

2018-11-01 Thread Michal Hocko
On Thu 01-11-18 18:00:12, Miles Chen wrote: [...] > I did a test today, the only code changed is to clamp to read count to > PAGE_SIZE and it worked well. Maybe we can solve this issue by just > clamping the read count. > > count = count > PAGE_SIZE ? PAGE_SIZE : count; This i what Matthew was

Re: [PATCH v3] mm/page_owner: use kvmalloc instead of kmalloc

2018-11-01 Thread Miles Chen
On Wed, 2018-10-31 at 12:41 +0100, Michal Hocko wrote: > On Wed 31-10-18 18:19:42, Miles Chen wrote: > > On Wed, 2018-10-31 at 11:15 +0100, Michal Hocko wrote: > > > On Wed 31-10-18 16:47:17, Miles Chen wrote: > > > > On Tue, 2018-10-30 at 09:15 +0100, Michal Hocko wrote: > > > > > On Tue 30-10-18

Re: [PATCH v3] mm/page_owner: use kvmalloc instead of kmalloc

2018-11-01 Thread Miles Chen
On Wed, 2018-10-31 at 12:41 +0100, Michal Hocko wrote: > On Wed 31-10-18 18:19:42, Miles Chen wrote: > > On Wed, 2018-10-31 at 11:15 +0100, Michal Hocko wrote: > > > On Wed 31-10-18 16:47:17, Miles Chen wrote: > > > > On Tue, 2018-10-30 at 09:15 +0100, Michal Hocko wrote: > > > > > On Tue 30-10-18

Re: [PATCH v3] mm/page_owner: use kvmalloc instead of kmalloc

2018-10-31 Thread Michal Hocko
On Wed 31-10-18 18:19:42, Miles Chen wrote: > On Wed, 2018-10-31 at 11:15 +0100, Michal Hocko wrote: > > On Wed 31-10-18 16:47:17, Miles Chen wrote: > > > On Tue, 2018-10-30 at 09:15 +0100, Michal Hocko wrote: > > > > On Tue 30-10-18 14:55:51, Miles Chen wrote: > > > > [...] > > > > > It's a real

Re: [PATCH v3] mm/page_owner: use kvmalloc instead of kmalloc

2018-10-31 Thread Michal Hocko
On Wed 31-10-18 18:19:42, Miles Chen wrote: > On Wed, 2018-10-31 at 11:15 +0100, Michal Hocko wrote: > > On Wed 31-10-18 16:47:17, Miles Chen wrote: > > > On Tue, 2018-10-30 at 09:15 +0100, Michal Hocko wrote: > > > > On Tue 30-10-18 14:55:51, Miles Chen wrote: > > > > [...] > > > > > It's a real

Re: [PATCH v3] mm/page_owner: use kvmalloc instead of kmalloc

2018-10-31 Thread Miles Chen
On Wed, 2018-10-31 at 11:15 +0100, Michal Hocko wrote: > On Wed 31-10-18 16:47:17, Miles Chen wrote: > > On Tue, 2018-10-30 at 09:15 +0100, Michal Hocko wrote: > > > On Tue 30-10-18 14:55:51, Miles Chen wrote: > > > [...] > > > > It's a real problem when using page_owner. > > > > I found this

Re: [PATCH v3] mm/page_owner: use kvmalloc instead of kmalloc

2018-10-31 Thread Miles Chen
On Wed, 2018-10-31 at 11:15 +0100, Michal Hocko wrote: > On Wed 31-10-18 16:47:17, Miles Chen wrote: > > On Tue, 2018-10-30 at 09:15 +0100, Michal Hocko wrote: > > > On Tue 30-10-18 14:55:51, Miles Chen wrote: > > > [...] > > > > It's a real problem when using page_owner. > > > > I found this

Re: [PATCH v3] mm/page_owner: use kvmalloc instead of kmalloc

2018-10-31 Thread Michal Hocko
On Wed 31-10-18 16:47:17, Miles Chen wrote: > On Tue, 2018-10-30 at 09:15 +0100, Michal Hocko wrote: > > On Tue 30-10-18 14:55:51, Miles Chen wrote: > > [...] > > > It's a real problem when using page_owner. > > > I found this issue recently: I'm not able to read page_owner information > > >

Re: [PATCH v3] mm/page_owner: use kvmalloc instead of kmalloc

2018-10-31 Thread Michal Hocko
On Wed 31-10-18 16:47:17, Miles Chen wrote: > On Tue, 2018-10-30 at 09:15 +0100, Michal Hocko wrote: > > On Tue 30-10-18 14:55:51, Miles Chen wrote: > > [...] > > > It's a real problem when using page_owner. > > > I found this issue recently: I'm not able to read page_owner information > > >

Re: [PATCH v3] mm/page_owner: use kvmalloc instead of kmalloc

2018-10-31 Thread Miles Chen
On Tue, 2018-10-30 at 09:15 +0100, Michal Hocko wrote: > On Tue 30-10-18 14:55:51, Miles Chen wrote: > [...] > > It's a real problem when using page_owner. > > I found this issue recently: I'm not able to read page_owner information > > during a overnight test. (error: read failed: Out of memory).

Re: [PATCH v3] mm/page_owner: use kvmalloc instead of kmalloc

2018-10-31 Thread Miles Chen
On Tue, 2018-10-30 at 09:15 +0100, Michal Hocko wrote: > On Tue 30-10-18 14:55:51, Miles Chen wrote: > [...] > > It's a real problem when using page_owner. > > I found this issue recently: I'm not able to read page_owner information > > during a overnight test. (error: read failed: Out of memory).

Re: [PATCH v3] mm/page_owner: use kvmalloc instead of kmalloc

2018-10-30 Thread Michal Hocko
On Tue 30-10-18 14:55:51, Miles Chen wrote: [...] > It's a real problem when using page_owner. > I found this issue recently: I'm not able to read page_owner information > during a overnight test. (error: read failed: Out of memory). I replace > kmalloc() with vmalloc() and it worked well. Is

Re: [PATCH v3] mm/page_owner: use kvmalloc instead of kmalloc

2018-10-30 Thread Michal Hocko
On Tue 30-10-18 14:55:51, Miles Chen wrote: [...] > It's a real problem when using page_owner. > I found this issue recently: I'm not able to read page_owner information > during a overnight test. (error: read failed: Out of memory). I replace > kmalloc() with vmalloc() and it worked well. Is

Re: [PATCH v3] mm/page_owner: use kvmalloc instead of kmalloc

2018-10-30 Thread Miles Chen
On Tue, 2018-10-30 at 07:06 +0100, Michal Hocko wrote: > On Tue 30-10-18 09:29:10, Miles Chen wrote: > > On Mon, 2018-10-29 at 09:17 +0100, Michal Hocko wrote: > > > On Mon 29-10-18 09:07:08, Michal Hocko wrote: > > > [...] > > > > Besides that, the following doesn't make much sense to me. It

Re: [PATCH v3] mm/page_owner: use kvmalloc instead of kmalloc

2018-10-30 Thread Miles Chen
On Tue, 2018-10-30 at 07:06 +0100, Michal Hocko wrote: > On Tue 30-10-18 09:29:10, Miles Chen wrote: > > On Mon, 2018-10-29 at 09:17 +0100, Michal Hocko wrote: > > > On Mon 29-10-18 09:07:08, Michal Hocko wrote: > > > [...] > > > > Besides that, the following doesn't make much sense to me. It

Re: [PATCH v3] mm/page_owner: use kvmalloc instead of kmalloc

2018-10-30 Thread Michal Hocko
On Tue 30-10-18 09:29:10, Miles Chen wrote: > On Mon, 2018-10-29 at 09:17 +0100, Michal Hocko wrote: > > On Mon 29-10-18 09:07:08, Michal Hocko wrote: > > [...] > > > Besides that, the following doesn't make much sense to me. It simply > > > makes no sense to use vmalloc for sub page allocation

Re: [PATCH v3] mm/page_owner: use kvmalloc instead of kmalloc

2018-10-30 Thread Michal Hocko
On Tue 30-10-18 09:29:10, Miles Chen wrote: > On Mon, 2018-10-29 at 09:17 +0100, Michal Hocko wrote: > > On Mon 29-10-18 09:07:08, Michal Hocko wrote: > > [...] > > > Besides that, the following doesn't make much sense to me. It simply > > > makes no sense to use vmalloc for sub page allocation

Re: [PATCH v3] mm/page_owner: use kvmalloc instead of kmalloc

2018-10-29 Thread Miles Chen
On Mon, 2018-10-29 at 09:17 +0100, Michal Hocko wrote: > On Mon 29-10-18 09:07:08, Michal Hocko wrote: > [...] > > Besides that, the following doesn't make much sense to me. It simply > > makes no sense to use vmalloc for sub page allocation regardless of > > HIGHMEM. > > OK, it is still early

Re: [PATCH v3] mm/page_owner: use kvmalloc instead of kmalloc

2018-10-29 Thread Miles Chen
On Mon, 2018-10-29 at 09:17 +0100, Michal Hocko wrote: > On Mon 29-10-18 09:07:08, Michal Hocko wrote: > [...] > > Besides that, the following doesn't make much sense to me. It simply > > makes no sense to use vmalloc for sub page allocation regardless of > > HIGHMEM. > > OK, it is still early

Re: [PATCH v3] mm/page_owner: use kvmalloc instead of kmalloc

2018-10-29 Thread Michal Hocko
On Mon 29-10-18 09:07:08, Michal Hocko wrote: [...] > Besides that, the following doesn't make much sense to me. It simply > makes no sense to use vmalloc for sub page allocation regardless of > HIGHMEM. OK, it is still early morning here. Now I get the point of the patch. You just want to

Re: [PATCH v3] mm/page_owner: use kvmalloc instead of kmalloc

2018-10-29 Thread Michal Hocko
On Mon 29-10-18 09:07:08, Michal Hocko wrote: [...] > Besides that, the following doesn't make much sense to me. It simply > makes no sense to use vmalloc for sub page allocation regardless of > HIGHMEM. OK, it is still early morning here. Now I get the point of the patch. You just want to

Re: [PATCH v3] mm/page_owner: use kvmalloc instead of kmalloc

2018-10-29 Thread Michal Hocko
On Mon 29-10-18 13:16:16, miles.c...@mediatek.com wrote: > From: Miles Chen > > The kbuf used by page owner is allocated by kmalloc(), which means it > can use only normal memory and there might be a "out of memory" > issue when we're out of normal memory. > > To solve this problem, use

Re: [PATCH v3] mm/page_owner: use kvmalloc instead of kmalloc

2018-10-29 Thread Michal Hocko
On Mon 29-10-18 13:16:16, miles.c...@mediatek.com wrote: > From: Miles Chen > > The kbuf used by page owner is allocated by kmalloc(), which means it > can use only normal memory and there might be a "out of memory" > issue when we're out of normal memory. > > To solve this problem, use

[PATCH v3] mm/page_owner: use kvmalloc instead of kmalloc

2018-10-28 Thread miles.chen
From: Miles Chen The kbuf used by page owner is allocated by kmalloc(), which means it can use only normal memory and there might be a "out of memory" issue when we're out of normal memory. To solve this problem, use kvmalloc() to allocate kbuf from normal/highmem. But there is one problem

[PATCH v3] mm/page_owner: use kvmalloc instead of kmalloc

2018-10-28 Thread miles.chen
From: Miles Chen The kbuf used by page owner is allocated by kmalloc(), which means it can use only normal memory and there might be a "out of memory" issue when we're out of normal memory. To solve this problem, use kvmalloc() to allocate kbuf from normal/highmem. But there is one problem