[bug report] read-ahead can't work properly

2019-06-24 Thread Weijie Yang
When try the file readahead by posix_fadvise(), I find it can't work properly. For example, posix_fadvise(POSIX_FADV_WILLNEED) a 10MB file, the kernel actually readahead only 512KB data to the page cache, even if there are enough free memory in the machine. When trace to kernel, I find the

[PATCH] mm fix commmets: If SPARSEMEM, pgdata doesn't have page_ext

2016-04-07 Thread Weijie Yang
If SPARSEMEM, use page_ext in mem_section if !SPARSEMEM, use page_ext in pgdata Signed-off-by: Weijie Yang <weijie.y...@samsung.com> --- include/linux/mmzone.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index c

[PATCH] mm fix commmets: If SPARSEMEM, pgdata doesn't have page_ext

2016-04-07 Thread Weijie Yang
If SPARSEMEM, use page_ext in mem_section if !SPARSEMEM, use page_ext in pgdata Signed-off-by: Weijie Yang --- include/linux/mmzone.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index c60df92..43c412c 100644 --- a/include

[PATCH] cma: allow concurrent cma pages allocation for multi-cma areas

2015-06-05 Thread Weijie Yang
cma_mutex and uses per-cma area alloc_lock, this allows concurrent cma pages allocation for different cma areas while protects access to the same pageblocks. Signed-off-by: Weijie Yang --- mm/cma.c |6 +++--- mm/cma.h |1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/mm

[PATCH] cma: allow concurrent cma pages allocation for multi-cma areas

2015-06-05 Thread Weijie Yang
cma_mutex and uses per-cma area alloc_lock, this allows concurrent cma pages allocation for different cma areas while protects access to the same pageblocks. Signed-off-by: Weijie Yang weijie.y...@samsung.com --- mm/cma.c |6 +++--- mm/cma.h |1 + 2 files changed, 4 insertions(+), 3 deletions

[PATCH] zram: clear disk io accounting when reset zram device

2015-05-28 Thread Weijie Yang
This patch clears zram disk io accounting when reset the zram device, if don't do this, the residual io accounting stat will affect the diskstat in the next zram active cycle. Signed-off-by: Weijie Yang --- drivers/block/zram/zram_drv.c |2 ++ 1 file changed, 2 insertions(+) diff --git

[PATCH] zram: clear disk io accounting when reset zram device

2015-05-28 Thread Weijie Yang
This patch clears zram disk io accounting when reset the zram device, if don't do this, the residual io accounting stat will affect the diskstat in the next zram active cycle. Signed-off-by: Weijie Yang weijie.y...@samsung.com --- drivers/block/zram/zram_drv.c |2 ++ 1 file changed, 2

[RESEND PATCH ] mm: page_alloc: place zone_id check before VM_BUG_ON_PAGE check

2014-12-13 Thread Weijie Yang
prevents the buddy page getting allocated they are not the same zone->lock. If we cann't remove the zone_id check statement, it's better handle this rare race. This patch fixes this by placing the zone_id check before the VM_BUG_ON_PAGE check. Signed-off-by: Weijie Yang Acked-by: Mel Gorman

[RESEND PATCH ] mm: page_alloc: place zone_id check before VM_BUG_ON_PAGE check

2014-12-13 Thread Weijie Yang
the buddy page getting allocated they are not the same zone-lock. If we cann't remove the zone_id check statement, it's better handle this rare race. This patch fixes this by placing the zone_id check before the VM_BUG_ON_PAGE check. Signed-off-by: Weijie Yang weijie.y...@samsung.com Acked-by: Mel

Re: [RFC PATCH] mm: mincore: use PAGE_SIZE instead of PAGE_CACHE_SIZE

2014-12-10 Thread Weijie Yang
ping. Any comments? On Wed, Nov 12, 2014 at 5:50 PM, Weijie Yang wrote: > This is a RFC patch, because current PAGE_SIZE is equal to PAGE_CACHE_SIZE, > there isn't any difference and issue when running. > > However, the current code mixes these two aligned_size in

Re: [PATCH 3/3] mm: page_alloc: remove redundant set_freepage_migratetype() calls

2014-12-10 Thread Weijie Yang
On Tue, Dec 9, 2014 at 5:49 PM, Vlastimil Babka wrote: > On 12/09/2014 08:51 AM, Weijie Yang wrote: >> >> The freepage_migratetype is a temporary cached value which represents >> the free page's pageblock migratetype. Now we use it in two scenarios: >> >> 1.

Re: [PATCH 2/3] mm: page_isolation: remove unnecessary freepage_migratetype check for unused page

2014-12-10 Thread Weijie Yang
On Tue, Dec 9, 2014 at 5:24 PM, Vlastimil Babka wrote: > On 12/09/2014 08:51 AM, Weijie Yang wrote: >> >> when we test the pages in a range is free or not, there is a little >> chance we encounter some page which is not in buddy but page_count is 0. >> That means tha

Re: [PATCH] mm: page_alloc: place zone id check before VM_BUG_ON_PAGE check

2014-12-10 Thread Weijie Yang
On Tue, Dec 9, 2014 at 5:59 PM, Mel Gorman wrote: > On Tue, Dec 09, 2014 at 03:40:35PM +0800, Weijie Yang wrote: >> If the free page and its buddy has different zone id, the current >> zone->lock cann't prevent buddy page getting allocated, this could >> trigger VM_BU

Re: [PATCH] mm: page_alloc: place zone id check before VM_BUG_ON_PAGE check

2014-12-10 Thread Weijie Yang
On Tue, Dec 9, 2014 at 5:59 PM, Mel Gorman mgor...@suse.de wrote: On Tue, Dec 09, 2014 at 03:40:35PM +0800, Weijie Yang wrote: If the free page and its buddy has different zone id, the current zone-lock cann't prevent buddy page getting allocated, this could trigger VM_BUG_ON_PAGE in a very

Re: [PATCH 2/3] mm: page_isolation: remove unnecessary freepage_migratetype check for unused page

2014-12-10 Thread Weijie Yang
On Tue, Dec 9, 2014 at 5:24 PM, Vlastimil Babka vba...@suse.cz wrote: On 12/09/2014 08:51 AM, Weijie Yang wrote: when we test the pages in a range is free or not, there is a little chance we encounter some page which is not in buddy but page_count is 0. That means that page could

Re: [PATCH 3/3] mm: page_alloc: remove redundant set_freepage_migratetype() calls

2014-12-10 Thread Weijie Yang
On Tue, Dec 9, 2014 at 5:49 PM, Vlastimil Babka vba...@suse.cz wrote: On 12/09/2014 08:51 AM, Weijie Yang wrote: The freepage_migratetype is a temporary cached value which represents the free page's pageblock migratetype. Now we use it in two scenarios: 1. Use it as a cached value in page

Re: [RFC PATCH] mm: mincore: use PAGE_SIZE instead of PAGE_CACHE_SIZE

2014-12-10 Thread Weijie Yang
ping. Any comments? On Wed, Nov 12, 2014 at 5:50 PM, Weijie Yang weijie.y...@samsung.com wrote: This is a RFC patch, because current PAGE_SIZE is equal to PAGE_CACHE_SIZE, there isn't any difference and issue when running. However, the current code mixes these two aligned_size inconsistently

[PATCH 3/3] mm: page_alloc: remove redundant set_freepage_migratetype() calls

2014-12-08 Thread Weijie Yang
. Use it in page alloc path to update NR_FREE_CMA_PAGES statistics. This patch aims at the scenario 1 and removes two redundant set_freepage_migratetype() calls, which will make sense in the hot path. Signed-off-by: Weijie Yang --- mm/page_alloc.c |2 -- 1 file changed, 2 deletions(-) diff

[PATCH 2/3] mm: page_isolation: remove unnecessary freepage_migratetype check for unused page

2014-12-08 Thread Weijie Yang
ion behavior by rechecking migratetype) patch series have ensure this. So the freepage_migratetype check for page_count==0 page in __test_page_isolated_in_pageblock() is meaningless. This patch removes the unnecessary freepage_migratetype check. Signed-off-by: Weijie Yang --- mm/page_isolation.c |

[PATCH 1/3] mm: page_isolation: remove redundant moving for isolated buddy pages

2014-12-08 Thread Weijie Yang
[MIGRATE_ISOLATE]. This patch removes the unnecessary freepage_migratetype check and the redundant page moving. Signed-off-by: Weijie Yang --- mm/page_isolation.c | 17 + 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/mm/page_isolation.c b/mm/page_isolation.c index

[PATCH] mm: page_alloc: place zone id check before VM_BUG_ON_PAGE check

2014-12-08 Thread Weijie Yang
ddy) is truehold zone_2 lock page_order(buddy) == order is true alloc buddy trigger VM_BUG_ON_PAGE(page_count(buddy) != 0) This patch fixes this issue by placing the zone id check before the VM_BUG_ON_PAGE check. Signed-off-by: Weijie Yang --- mm/page_alloc.c |

[PATCH] mm: page_alloc: place zone id check before VM_BUG_ON_PAGE check

2014-12-08 Thread Weijie Yang
) is truehold zone_2 lock page_order(buddy) == order is true alloc buddy trigger VM_BUG_ON_PAGE(page_count(buddy) != 0) This patch fixes this issue by placing the zone id check before the VM_BUG_ON_PAGE check. Signed-off-by: Weijie Yang weijie.y...@samsung.com --- mm

[PATCH 1/3] mm: page_isolation: remove redundant moving for isolated buddy pages

2014-12-08 Thread Weijie Yang
[MIGRATE_ISOLATE]. This patch removes the unnecessary freepage_migratetype check and the redundant page moving. Signed-off-by: Weijie Yang weijie.y...@samsung.com --- mm/page_isolation.c | 17 + 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/mm/page_isolation.c b/mm

[PATCH 2/3] mm: page_isolation: remove unnecessary freepage_migratetype check for unused page

2014-12-08 Thread Weijie Yang
behavior by rechecking migratetype) patch series have ensure this. So the freepage_migratetype check for page_count==0 page in __test_page_isolated_in_pageblock() is meaningless. This patch removes the unnecessary freepage_migratetype check. Signed-off-by: Weijie Yang weijie.y...@samsung.com --- mm

[PATCH 3/3] mm: page_alloc: remove redundant set_freepage_migratetype() calls

2014-12-08 Thread Weijie Yang
. Use it in page alloc path to update NR_FREE_CMA_PAGES statistics. This patch aims at the scenario 1 and removes two redundant set_freepage_migratetype() calls, which will make sense in the hot path. Signed-off-by: Weijie Yang weijie.y...@samsung.com --- mm/page_alloc.c |2 -- 1 file changed, 2

Re: [PATCH] mm: page_alloc: store updated page migratetype to avoid misusing stale value

2014-11-20 Thread Weijie Yang
On Thu, Nov 20, 2014 at 5:28 AM, Vlastimil Babka wrote: > On 11/17/2014 11:40 AM, Weijie Yang wrote: >> The commit ad53f92e(fix incorrect isolation behavior by rechecking >> migratetype) >> patch series describe the race between page isolation and free path, and try >

Re: [PATCH] mm: page_alloc: store updated page migratetype to avoid misusing stale value

2014-11-20 Thread Weijie Yang
On Thu, Nov 20, 2014 at 5:28 AM, Vlastimil Babka vba...@suse.cz wrote: On 11/17/2014 11:40 AM, Weijie Yang wrote: The commit ad53f92e(fix incorrect isolation behavior by rechecking migratetype) patch series describe the race between page isolation and free path, and try to fix the freepage

Re: [PATCH] mm: frontswap: invalidate expired data on a dup-store failure

2014-11-19 Thread Weijie Yang
On Wed, Nov 19, 2014 at 6:29 AM, Seth Jennings wrote: > On Tue, Nov 18, 2014 at 04:51:36PM +0800, Weijie Yang wrote: >> If a frontswap dup-store failed, it should invalidate the expired page >> in the backend, or it could trigger some data corruption issue. >> Suc

Re: [PATCH] mm: frontswap: invalidate expired data on a dup-store failure

2014-11-19 Thread Weijie Yang
On Wed, Nov 19, 2014 at 6:29 AM, Seth Jennings sjenni...@variantweb.net wrote: On Tue, Nov 18, 2014 at 04:51:36PM +0800, Weijie Yang wrote: If a frontswap dup-store failed, it should invalidate the expired page in the backend, or it could trigger some data corruption issue. Such as: 1. use

[PATCH] mm: frontswap: invalidate expired data on a dup-store failure

2014-11-18 Thread Weijie Yang
failure. Signed-off-by: Weijie Yang --- mm/frontswap.c |4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/mm/frontswap.c b/mm/frontswap.c index c30eec5..f2a3571 100644 --- a/mm/frontswap.c +++ b/mm/frontswap.c @@ -244,8 +244,10 @@ int __frontswap_store(struct page *page

[PATCH] mm: frontswap: invalidate expired data on a dup-store failure

2014-11-18 Thread Weijie Yang
failure. Signed-off-by: Weijie Yang weijie.y...@samsung.com --- mm/frontswap.c |4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/mm/frontswap.c b/mm/frontswap.c index c30eec5..f2a3571 100644 --- a/mm/frontswap.c +++ b/mm/frontswap.c @@ -244,8 +244,10 @@ int

[PATCH] mm: page_alloc: store updated page migratetype to avoid misusing stale value

2014-11-17 Thread Weijie Yang
free the page to the free_list to avoid subsequent misusing stale value, and use a WARN_ON_ONCE to catch a potential undetected race between isolatation and free path. Signed-off-by: Weijie Yang --- mm/page_alloc.c |1 + mm/page_isolation.c | 17 + 2 files changed, 6

[PATCH] mm: page_alloc: store updated page migratetype to avoid misusing stale value

2014-11-17 Thread Weijie Yang
free the page to the free_list to avoid subsequent misusing stale value, and use a WARN_ON_ONCE to catch a potential undetected race between isolatation and free path. Signed-off-by: Weijie Yang weijie.y...@samsung.com --- mm/page_alloc.c |1 + mm/page_isolation.c | 17 + 2

Re: [PATCH v5 1/4] mm/page_alloc: fix incorrect isolation behavior by rechecking migratetype

2014-11-14 Thread Weijie Yang
On Fri, Oct 31, 2014 at 3:25 PM, Joonsoo Kim wrote: > There are two paths to reach core free function of buddy allocator, > __free_one_page(), one is free_one_page()->__free_one_page() and the > other is free_hot_cold_page()->free_pcppages_bulk()->__free_one_page(). > Each paths has race

Re: [PATCH v5 1/4] mm/page_alloc: fix incorrect isolation behavior by rechecking migratetype

2014-11-14 Thread Weijie Yang
On Fri, Oct 31, 2014 at 3:25 PM, Joonsoo Kim iamjoonsoo@lge.com wrote: There are two paths to reach core free function of buddy allocator, __free_one_page(), one is free_one_page()-__free_one_page() and the other is free_hot_cold_page()-free_pcppages_bulk()-__free_one_page(). Each paths

Re: [PATCH 1/2] mm: page_isolation: check pfn validity before access

2014-11-12 Thread Weijie Yang
On Thu, Nov 13, 2014 at 3:34 AM, Michal Hocko wrote: > On Thu 06-11-14 16:08:02, Weijie Yang wrote: >> In the undo path of start_isolate_page_range(), we need to check >> the pfn validity before access its page, or it will trigger an >> addressing exception if ther

RE: [PATCH] mm/zram: correct ZRAM_ZERO flag bit position

2014-11-12 Thread Weijie Yang
ge in now accessed" -> "page is now >> accessed" >> >> Signed-off-by: Mahendran Ganesh > Acked-by: Minchan Kim Acked-by: Weijie Yang > To be clear about "fixes this issue", it's not a bug but just clean up > so it doesn't change any behavi

[RFC PATCH] mm: mincore: use PAGE_SIZE instead of PAGE_CACHE_SIZE

2014-11-12 Thread Weijie Yang
wanted. According to man-page, mincore uses PAGE_SIZE as its size unit, so this patch uses PAGE_SIZE instead of PAGE_CACHE_SIZE. Signed-off-by: Weijie Yang --- mm/mincore.c | 19 +-- 1 files changed, 13 insertions(+), 6 deletions(-) diff --git a/mm/mincore.c b/mm/mincore.c index

[RFC PATCH] mm: mincore: use PAGE_SIZE instead of PAGE_CACHE_SIZE

2014-11-12 Thread Weijie Yang
wanted. According to man-page, mincore uses PAGE_SIZE as its size unit, so this patch uses PAGE_SIZE instead of PAGE_CACHE_SIZE. Signed-off-by: Weijie Yang weijie.y...@samsung.com --- mm/mincore.c | 19 +-- 1 files changed, 13 insertions(+), 6 deletions(-) diff --git a/mm/mincore.c

RE: [PATCH] mm/zram: correct ZRAM_ZERO flag bit position

2014-11-12 Thread Weijie Yang
-by: Mahendran Ganesh opensource.gan...@gmail.com Acked-by: Minchan Kim minc...@kernel.org Acked-by: Weijie Yang weijie.y...@samsung.com To be clear about fixes this issue, it's not a bug but just clean up so it doesn't change any behavior. Thanks! -- Kind regards, Minchan Kim -- To unsubscribe

Re: [PATCH 1/2] mm: page_isolation: check pfn validity before access

2014-11-12 Thread Weijie Yang
On Thu, Nov 13, 2014 at 3:34 AM, Michal Hocko mho...@suse.cz wrote: On Thu 06-11-14 16:08:02, Weijie Yang wrote: In the undo path of start_isolate_page_range(), we need to check the pfn validity before access its page, or it will trigger an addressing exception if there is hole in the zone

[PATCH] mm: mincore: add hwpoison page handle

2014-11-11 Thread Weijie Yang
When encounter pte is a swap entry, the current code handles two cases: migration and normal swapentry, but we have a third case: hwpoison page. This patch adds hwpoison page handle, consider hwpoison page incore as same as migration. Signed-off-by: Weijie Yang --- mm/mincore.c |4 ++-- 1

Re: [PATCH 1/2] mm: page_isolation: check pfn validity before access

2014-11-11 Thread Weijie Yang
On Wed, Nov 12, 2014 at 6:23 AM, Andrew Morton wrote: > On Thu, 06 Nov 2014 16:08:02 +0800 Weijie Yang > wrote: > >> In the undo path of start_isolate_page_range(), we need to check >> the pfn validity before access its page, or it will trigger an >> addressing

Re: [PATCH 1/2] mm: page_isolation: check pfn validity before access

2014-11-11 Thread Weijie Yang
On Wed, Nov 12, 2014 at 6:23 AM, Andrew Morton a...@linux-foundation.org wrote: On Thu, 06 Nov 2014 16:08:02 +0800 Weijie Yang weijie.y...@samsung.com wrote: In the undo path of start_isolate_page_range(), we need to check the pfn validity before access its page, or it will trigger

[PATCH] mm: mincore: add hwpoison page handle

2014-11-11 Thread Weijie Yang
When encounter pte is a swap entry, the current code handles two cases: migration and normal swapentry, but we have a third case: hwpoison page. This patch adds hwpoison page handle, consider hwpoison page incore as same as migration. Signed-off-by: Weijie Yang weijie.y...@samsung.com --- mm

Re: [PATCH 2/2] mm: page_isolation: fix zone_freepage accounting

2014-11-06 Thread Weijie Yang
On Thu, Nov 6, 2014 at 4:49 PM, Joonsoo Kim wrote: > On Thu, Nov 06, 2014 at 04:09:08PM +0800, Weijie Yang wrote: >> If race between isolatation and allocation happens, we could need to move >> some freepages to MIGRATE_ISOLATE in __test_page_isolated_in_pageblock(). >> The

[PATCH 2/2] mm: page_isolation: fix zone_freepage accounting

2014-11-06 Thread Weijie Yang
. This patch fixes this rare issue. Signed-off-by: Weijie Yang --- mm/page_isolation.c |5 - 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/mm/page_isolation.c b/mm/page_isolation.c index 3ddc8b3..15b51de 100644 --- a/mm/page_isolation.c +++ b/mm/page_isolation.c @@ -193,12

[PATCH 1/2] mm: page_isolation: check pfn validity before access

2014-11-06 Thread Weijie Yang
In the undo path of start_isolate_page_range(), we need to check the pfn validity before access its page, or it will trigger an addressing exception if there is hole in the zone. Signed-off-by: Weijie Yang --- mm/page_isolation.c |7 +-- 1 files changed, 5 insertions(+), 2 deletions

Re: [PATCH 2/2] mm: page_isolation: fix zone_freepage accounting

2014-11-06 Thread Weijie Yang
On Thu, Nov 6, 2014 at 4:49 PM, Joonsoo Kim iamjoonsoo@lge.com wrote: On Thu, Nov 06, 2014 at 04:09:08PM +0800, Weijie Yang wrote: If race between isolatation and allocation happens, we could need to move some freepages to MIGRATE_ISOLATE in __test_page_isolated_in_pageblock(). The current

[PATCH 2/2] mm: page_isolation: fix zone_freepage accounting

2014-11-06 Thread Weijie Yang
. This patch fixes this rare issue. Signed-off-by: Weijie Yang weijie.y...@samsung.com --- mm/page_isolation.c |5 - 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/mm/page_isolation.c b/mm/page_isolation.c index 3ddc8b3..15b51de 100644 --- a/mm/page_isolation.c +++ b/mm

[PATCH 1/2] mm: page_isolation: check pfn validity before access

2014-11-06 Thread Weijie Yang
In the undo path of start_isolate_page_range(), we need to check the pfn validity before access its page, or it will trigger an addressing exception if there is hole in the zone. Signed-off-by: Weijie Yang weijie.y...@samsung.com --- mm/page_isolation.c |7 +-- 1 files changed, 5

Re: CMA alignment question

2014-11-05 Thread Weijie Yang
t >>> - the CMA region is not 16 M aligned > > On Wed, Nov 05 2014, Weijie Yang wrote: >> I think the device driver should ensure that situation could not occur, >> by assign suitable alignment parameter in cma_declare_contiguous(). > > What about default CMA area

Re: CMA alignment question

2014-11-05 Thread Weijie Yang
On Wed, Nov 05 2014, Weijie Yang wrote: I think the device driver should ensure that situation could not occur, by assign suitable alignment parameter in cma_declare_contiguous(). What about default CMA area? Besides, I think principle of least surprise applies here and alignment should

Re: CMA alignment question

2014-11-04 Thread Weijie Yang
On Wed, Nov 5, 2014 at 12:18 PM, Gregory Fong wrote: > On Tue, Nov 4, 2014 at 2:27 PM, Michal Nazarewicz wrote: >> On Tue, Nov 04 2014, Gregory Fong wrote: >>> The alignment in cma_alloc() is done w.r.t. the bitmap. This is a >>> problem when, for example: >>> >>> - a device requires 16M (order

Re: CMA alignment question

2014-11-04 Thread Weijie Yang
On Wed, Nov 5, 2014 at 12:18 PM, Gregory Fong gregory.0...@gmail.com wrote: On Tue, Nov 4, 2014 at 2:27 PM, Michal Nazarewicz min...@mina86.com wrote: On Tue, Nov 04 2014, Gregory Fong wrote: The alignment in cma_alloc() is done w.r.t. the bitmap. This is a problem when, for example: - a

[PATCH] zram: avoid kunmap_atomic a NULL pointer

2014-10-30 Thread Weijie Yang
zram could kunmap_atomic a NULL pointer in a rare situation: a zram page become a full-zeroed page after a partial write io. The current code doesn't handle this case and kunmap_atomic a NULL porinter, which panic the kernel. This patch fixes this issue. Signed-off-by: Weijie Yang --- drivers

[PATCH] zram: avoid kunmap_atomic a NULL pointer

2014-10-30 Thread Weijie Yang
zram could kunmap_atomic a NULL pointer in a rare situation: a zram page become a full-zeroed page after a partial write io. The current code doesn't handle this case and kunmap_atomic a NULL porinter, which panic the kernel. This patch fixes this issue. Signed-off-by: Weijie Yang weijie.y

[tip:x86/urgent] x86, cma: Reserve DMA contiguous area after initmem_init()

2014-10-28 Thread tip-bot for Weijie Yang
Commit-ID: 3c325f8233c35fb35dec3744ba01634aab4ea36a Gitweb: http://git.kernel.org/tip/3c325f8233c35fb35dec3744ba01634aab4ea36a Author: Weijie Yang AuthorDate: Fri, 24 Oct 2014 17:00:34 +0800 Committer: Ingo Molnar CommitDate: Tue, 28 Oct 2014 07:36:50 +0100 x86, cma: Reserve DMA

[tip:x86/urgent] x86, cma: Reserve DMA contiguous area after initmem_init()

2014-10-28 Thread tip-bot for Weijie Yang
Commit-ID: 3c325f8233c35fb35dec3744ba01634aab4ea36a Gitweb: http://git.kernel.org/tip/3c325f8233c35fb35dec3744ba01634aab4ea36a Author: Weijie Yang weijie.y...@samsung.com AuthorDate: Fri, 24 Oct 2014 17:00:34 +0800 Committer: Ingo Molnar mi...@kernel.org CommitDate: Tue, 28 Oct 2014 07

[PATCH] zram: avoid NULL pointer access in concurrent situation

2014-10-26 Thread Weijie Yang
B access meta, get a NULL value init zram, done init_done() is true access meta->mem_pool, get a NULL pointer BUG This patch fixes this issue. Signed-off-by: Weijie Yang Acked-by: Minchan Kim Acked-by: Sergey Senozhatsky --- drivers/block/z

Re: [PATCH 1/2] zram: make max_used_pages reset work correctly

2014-10-26 Thread Weijie Yang
On Sun, Oct 26, 2014 at 9:41 AM, Minchan Kim wrote: > Hello, > > On Sat, Oct 25, 2014 at 05:25:11PM +0800, Weijie Yang wrote: >> The commit 461a8eee6a ("zram: report maximum used memory") introduces a new >> knob "mem_used_max" in zram.stats

Re: [PATCH 1/2] zram: make max_used_pages reset work correctly

2014-10-26 Thread Weijie Yang
On Sun, Oct 26, 2014 at 9:41 AM, Minchan Kim minc...@kernel.org wrote: Hello, On Sat, Oct 25, 2014 at 05:25:11PM +0800, Weijie Yang wrote: The commit 461a8eee6a (zram: report maximum used memory) introduces a new knob mem_used_max in zram.stats sysfs, and wants to reset it via write 0

[PATCH] zram: avoid NULL pointer access in concurrent situation

2014-10-26 Thread Weijie Yang
B access meta, get a NULL value init zram, done init_done() is true access meta-mem_pool, get a NULL pointer BUG This patch fixes this issue. Signed-off-by: Weijie Yang weijie.y...@samsung.com Acked-by: Minchan Kim minc...@kernel.org Acked-by: Sergey

[PATCH 2/2] zram: avoid NULL pointer access when reading mem_used_total

2014-10-25 Thread Weijie Yang
value init zram, done init_done() is true access meta->mem_pool, get a NULL pointer BUG This patch fixes this issue. Signed-off-by: Weijie Yang --- drivers/block/zram/zram_drv.c |5 +++-- 1 files changed, 3 insertions(+), 2 deleti

[PATCH 1/2] zram: make max_used_pages reset work correctly

2014-10-25 Thread Weijie Yang
The commit 461a8eee6a ("zram: report maximum used memory") introduces a new knob "mem_used_max" in zram.stats sysfs, and wants to reset it via write 0 to the sysfs interface. However, the current code cann't reset it correctly, so let's fix it. Signed-off-by: Weijie Yang ---

[PATCH 1/2] zram: make max_used_pages reset work correctly

2014-10-25 Thread Weijie Yang
The commit 461a8eee6a (zram: report maximum used memory) introduces a new knob mem_used_max in zram.stats sysfs, and wants to reset it via write 0 to the sysfs interface. However, the current code cann't reset it correctly, so let's fix it. Signed-off-by: Weijie Yang weijie.y...@samsung.com

[PATCH 2/2] zram: avoid NULL pointer access when reading mem_used_total

2014-10-25 Thread Weijie Yang
value init zram, done init_done() is true access meta-mem_pool, get a NULL pointer BUG This patch fixes this issue. Signed-off-by: Weijie Yang weijie.y...@samsung.com --- drivers/block/zram/zram_drv.c |5 +++-- 1 files changed, 3

[PATCH] mm, cma: make parameters order consistent in func declaration and definition

2014-10-24 Thread Weijie Yang
order consistent in functions declaration and definition. Signed-off-by: Weijie Yang --- include/linux/cma.h |8 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/linux/cma.h b/include/linux/cma.h index 0430ed0..a93438b 100644 --- a/include/linux/cma.h +++ b

[PATCH] x86, cma: reserve dma contiguous area after initmem_init()

2014-10-24 Thread Weijie Yang
r initmem_init() so that high_memory is initialized before accessed. Reported-by: Fengguang Wu Signed-off-by: Weijie Yang --- arch/x86/kernel/setup.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index 235cfd3..ab08aa2 100644

[PATCH] x86, cma: reserve dma contiguous area after initmem_init()

2014-10-24 Thread Weijie Yang
...@intel.com Signed-off-by: Weijie Yang weijie.y...@samsung.com --- arch/x86/kernel/setup.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index 235cfd3..ab08aa2 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c

[PATCH] mm, cma: make parameters order consistent in func declaration and definition

2014-10-24 Thread Weijie Yang
order consistent in functions declaration and definition. Signed-off-by: Weijie Yang weijie.y...@samsung.com --- include/linux/cma.h |8 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/linux/cma.h b/include/linux/cma.h index 0430ed0..a93438b 100644 --- a/include

Re: [PATCH 1/4] mm: cma: Don't crash on allocation if CMA area can't be activated

2014-10-23 Thread Weijie Yang
On Fri, Oct 24, 2014 at 7:42 AM, Laurent Pinchart wrote: > Hi Michal, > > On Thursday 23 October 2014 18:53:36 Michal Nazarewicz wrote: >> On Thu, Oct 23 2014, Laurent Pinchart wrote: >> > If activation of the CMA area fails its mutex won't be initialized, >> > leading to an oops at allocation

Re: [mm] BUG: Int 6: CR2 (null)

2014-10-23 Thread Weijie Yang
On Thu, Oct 9, 2014 at 10:04 AM, Fengguang Wu wrote: > Hi Marek, > > FYI, we noticed the below changes on > > git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master > commit 478e86d7c8c5f41e29abb81b05b459d24bdc71a2 ("mm: cma: adjust address > limit to avoid hitting low/high

Re: [mm] BUG: Int 6: CR2 (null)

2014-10-23 Thread Weijie Yang
On Thu, Oct 9, 2014 at 10:04 AM, Fengguang Wu fengguang...@intel.com wrote: Hi Marek, FYI, we noticed the below changes on git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master commit 478e86d7c8c5f41e29abb81b05b459d24bdc71a2 (mm: cma: adjust address limit to avoid

Re: [PATCH 1/4] mm: cma: Don't crash on allocation if CMA area can't be activated

2014-10-23 Thread Weijie Yang
On Fri, Oct 24, 2014 at 7:42 AM, Laurent Pinchart laurent.pinch...@ideasonboard.com wrote: Hi Michal, On Thursday 23 October 2014 18:53:36 Michal Nazarewicz wrote: On Thu, Oct 23 2014, Laurent Pinchart wrote: If activation of the CMA area fails its mutex won't be initialized, leading to an

Re: [PATCH 0/4] (CMA_AGGRESSIVE) Make CMA memory be more aggressive about allocation

2014-10-15 Thread Weijie Yang
On Thu, Oct 16, 2014 at 11:35 AM, Hui Zhu wrote: > In fallbacks of page_alloc.c, MIGRATE_CMA is the fallback of > MIGRATE_MOVABLE. > MIGRATE_MOVABLE will use MIGRATE_CMA when it doesn't have a page in > order that Linux kernel want. > > If a system that has a lot of user space program is running,

Re: [PATCH 0/4] (CMA_AGGRESSIVE) Make CMA memory be more aggressive about allocation

2014-10-15 Thread Weijie Yang
On Thu, Oct 16, 2014 at 11:35 AM, Hui Zhu zhu...@xiaomi.com wrote: In fallbacks of page_alloc.c, MIGRATE_CMA is the fallback of MIGRATE_MOVABLE. MIGRATE_MOVABLE will use MIGRATE_CMA when it doesn't have a page in order that Linux kernel want. If a system that has a lot of user space program

[PATCH] mm/cma: fix cma bitmap aligned mask computing

2014-10-09 Thread Weijie Yang
alloc kvm_rma_pages, it will input 15 as expected align value, after using current computing, however, we get 0 as cma bitmap aligned mask other than 511. This patch fixes the cma bitmap aligned mask compute way. Signed-off-by: Weijie Yang --- mm/cma.c |5 - 1 file changed, 4 insertions(+), 1 de

[PATCH] mm/cma: fix cma bitmap aligned mask computing

2014-10-09 Thread Weijie Yang
kvm_rma_pages, it will input 15 as expected align value, after using current computing, however, we get 0 as cma bitmap aligned mask other than 511. This patch fixes the cma bitmap aligned mask compute way. Signed-off-by: Weijie Yang weijie.y...@samsung.com --- mm/cma.c |5 - 1 file changed, 4

Re: [PATCH] Fix the issue that lowmemkiller fell into a cycle that try to kill a task

2014-09-23 Thread Weijie Yang
On Tue, Sep 23, 2014 at 12:48 PM, 朱辉 wrote: > > > On 09/23/14 12:18, Greg KH wrote: >> On Tue, Sep 23, 2014 at 10:57:09AM +0800, Hui Zhu wrote: >>> The cause of this issue is when free memroy size is low and a lot of task is >>> trying to shrink the memory, the task that is killed by lowmemkiller

Re: [PATCH] Fix the issue that lowmemkiller fell into a cycle that try to kill a task

2014-09-23 Thread Weijie Yang
On Tue, Sep 23, 2014 at 12:48 PM, 朱辉 zhu...@xiaomi.com wrote: On 09/23/14 12:18, Greg KH wrote: On Tue, Sep 23, 2014 at 10:57:09AM +0800, Hui Zhu wrote: The cause of this issue is when free memroy size is low and a lot of task is trying to shrink the memory, the task that is killed by

Re: [PATCH] mm: page_alloc: avoid wakeup kswapd on the unintended node

2014-08-29 Thread Weijie Yang
On Fri, Aug 29, 2014 at 4:12 PM, Mel Gorman wrote: > On Fri, Aug 29, 2014 at 03:03:19PM +0800, Weijie Yang wrote: >> When enter page_alloc slowpath, we wakeup kswapd on every pgdat >> according to the zonelist and high_zoneidx. However, this doesn't >> take nodemask in

[PATCH] mm: page_alloc: avoid wakeup kswapd on the unintended node

2014-08-29 Thread Weijie Yang
of for_each_zone_zonelist() in wake_all_kswapds() to avoid the above situation. Signed-off-by: Weijie Yang --- mm/page_alloc.c |9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 18cee0d..29b595a 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c

[PATCH] mm: page_alloc: avoid wakeup kswapd on the unintended node

2014-08-29 Thread Weijie Yang
of for_each_zone_zonelist() in wake_all_kswapds() to avoid the above situation. Signed-off-by: Weijie Yang weijie.y...@samsung.com --- mm/page_alloc.c |9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 18cee0d..29b595a 100644 --- a/mm/page_alloc.c

Re: [PATCH] mm: page_alloc: avoid wakeup kswapd on the unintended node

2014-08-29 Thread Weijie Yang
On Fri, Aug 29, 2014 at 4:12 PM, Mel Gorman mgor...@suse.de wrote: On Fri, Aug 29, 2014 at 03:03:19PM +0800, Weijie Yang wrote: When enter page_alloc slowpath, we wakeup kswapd on every pgdat according to the zonelist and high_zoneidx. However, this doesn't take nodemask into account

Re: [PATCH v3] zram: remove global tb_lock with fine grain lock

2014-06-03 Thread Weijie Yang
On Tue, Jun 3, 2014 at 4:22 PM, Minchan Kim wrote: > Hello, > > On Tue, Jun 03, 2014 at 03:59:06PM +0800, Weijie Yang wrote: >> On Mon, Jun 2, 2014 at 8:43 AM, Minchan Kim wrote: >> > Hello Weijie, >> > >> > Thanks for resending. >> > Below

Re: [PATCH v3] zram: remove global tb_lock with fine grain lock

2014-06-03 Thread Weijie Yang
On Mon, Jun 2, 2014 at 8:43 AM, Minchan Kim wrote: > Hello Weijie, > > Thanks for resending. > Below are mostly nitpicks. > > On Fri, May 30, 2014 at 04:34:44PM +0800, Weijie Yang wrote: >> Currently, we use a rwlock tb_lock to protect concurrent access to >> the

Re: [PATCH v3] zram: remove global tb_lock with fine grain lock

2014-06-03 Thread Weijie Yang
On Mon, Jun 2, 2014 at 8:43 AM, Minchan Kim minc...@kernel.org wrote: Hello Weijie, Thanks for resending. Below are mostly nitpicks. On Fri, May 30, 2014 at 04:34:44PM +0800, Weijie Yang wrote: Currently, we use a rwlock tb_lock to protect concurrent access to the whole zram meta table

Re: [PATCH v3] zram: remove global tb_lock with fine grain lock

2014-06-03 Thread Weijie Yang
On Tue, Jun 3, 2014 at 4:22 PM, Minchan Kim minc...@kernel.org wrote: Hello, On Tue, Jun 03, 2014 at 03:59:06PM +0800, Weijie Yang wrote: On Mon, Jun 2, 2014 at 8:43 AM, Minchan Kim minc...@kernel.org wrote: Hello Weijie, Thanks for resending. Below are mostly nitpicks. On Fri, May

[PATCH v3] zram: remove global tb_lock with fine grain lock

2014-05-30 Thread Weijie Yang
lag() to zram_test_zero() - add some comments Changes since v2: https://lkml.org/lkml/2014/5/15/113 - change size type from int to size_t in zram_set_obj_size() - refactor zram_set_obj_size() to make it readable - add comments Signed-off-by: Weijie Yang --- drivers/block/zram/zram_drv.c |

[PATCH v3] zram: remove global tb_lock with fine grain lock

2014-05-30 Thread Weijie Yang
() to zram_test_zero() - add some comments Changes since v2: https://lkml.org/lkml/2014/5/15/113 - change size type from int to size_t in zram_set_obj_size() - refactor zram_set_obj_size() to make it readable - add comments Signed-off-by: Weijie Yang weijie.y...@samsung.com --- drivers/block

Re: [PATCH v2] zram: remove global tb_lock with fine grain lock

2014-05-26 Thread Weijie Yang
Hello, Sorry for my late reply, because of a biz trip. On Wed, May 21, 2014 at 3:51 PM, Minchan Kim wrote: > Hello Andrew, > > On Tue, May 20, 2014 at 03:10:51PM -0700, Andrew Morton wrote: >> On Thu, 15 May 2014 16:00:47 +0800 Weijie Yang >> wrote: >> >> >

Re: [PATCH v2] zram: remove global tb_lock with fine grain lock

2014-05-26 Thread Weijie Yang
Hello, Sorry for my late reply, because of a biz trip. On Wed, May 21, 2014 at 3:51 PM, Minchan Kim minc...@kernel.org wrote: Hello Andrew, On Tue, May 20, 2014 at 03:10:51PM -0700, Andrew Morton wrote: On Thu, 15 May 2014 16:00:47 +0800 Weijie Yang weijie.y...@samsung.com wrote

Re: [PATCH v2] zram: remove global tb_lock with fine grain lock

2014-05-16 Thread Weijie Yang
On Fri, May 16, 2014 at 2:51 PM, Minchan Kim wrote: > Hello Andrew, > > On Thu, May 15, 2014 at 02:38:56PM -0700, Andrew Morton wrote: >> On Thu, 15 May 2014 16:00:47 +0800 Weijie Yang >> wrote: >> >> > Currently, we use a rwlock tb_lock to protect concurren

Re: [PATCH v2] zram: remove global tb_lock with fine grain lock

2014-05-16 Thread Weijie Yang
On Fri, May 16, 2014 at 2:51 PM, Minchan Kim minc...@kernel.org wrote: Hello Andrew, On Thu, May 15, 2014 at 02:38:56PM -0700, Andrew Morton wrote: On Thu, 15 May 2014 16:00:47 +0800 Weijie Yang weijie.y...@samsung.com wrote: Currently, we use a rwlock tb_lock to protect concurrent access

[PATCH] zsmalloc: fixup trivial zs size classes value in comments

2014-05-15 Thread Weijie Yang
According to calculation, ZS_SIZE_CLASSES value is 255 on systems with 4K page size, not 254. The old value may forget count the ZS_MIN_ALLOC_SIZE in. This patch fixup this trivial issue in the comments. Signed-off-by: Weijie Yang --- mm/zsmalloc.c |2 +- 1 file changed, 1 insertion(+), 1

[PATCH v2] zram: remove global tb_lock with fine grain lock

2014-05-15 Thread Weijie Yang
lag() to zram_test_zero() - add some comments - change the patch subject Signed-off-by: Weijie Yang --- drivers/block/zram/zram_drv.c | 84 +++-- drivers/block/zram/zram_drv.h | 22 --- 2 files changed, 63 insertions(+), 43 deletions(-) diff --

[PATCH v2] zram: remove global tb_lock with fine grain lock

2014-05-15 Thread Weijie Yang
() to zram_test_zero() - add some comments - change the patch subject Signed-off-by: Weijie Yang weijie.y...@samsung.com --- drivers/block/zram/zram_drv.c | 84 +++-- drivers/block/zram/zram_drv.h | 22 --- 2 files changed, 63 insertions(+), 43

[PATCH] zsmalloc: fixup trivial zs size classes value in comments

2014-05-15 Thread Weijie Yang
According to calculation, ZS_SIZE_CLASSES value is 255 on systems with 4K page size, not 254. The old value may forget count the ZS_MIN_ALLOC_SIZE in. This patch fixup this trivial issue in the comments. Signed-off-by: Weijie Yang weijie.y...@samsung.com --- mm/zsmalloc.c |2 +- 1 file

RE: [PATCH] zram: remove global tb_lock by using lock-free CAS

2014-05-10 Thread Weijie Yang
On Thu, May 8, 2014 at 2:24 PM, Minchan Kim wrote: > On Wed, May 07, 2014 at 11:52:59PM +0900, Joonsoo Kim wrote: >> >> Most popular use of zram is the in-memory swap for small embedded system >> >> so I don't want to increase memory footprint without good reason although >> >> it makes synthetic

  1   2   3   >