2013/8/23 Seth Jennings :
> On Fri, Aug 23, 2013 at 07:03:37PM +0800, Weijie Yang wrote:
>> zswap_tree is not freed when swapoff, and it got re-kzalloc in swapon,
>> memory leak occurs.
>> Add check statement in zswap_frontswap_init so that zswap_tree is
>> inited
First, I apologize for my delay reply and appreciate the review from
you and Bob Liu.
On Tue, Sep 10, 2013 at 1:03 AM, Seth Jennings
wrote:
> On Fri, Sep 06, 2013 at 01:16:45PM +0800, Weijie Yang wrote:
>> zswap_tree is not freed when swapoff, and it got re-kmalloc in swapon,
>>
On Tue, Sep 10, 2013 at 12:47 AM, Seth Jennings
wrote:
> On Fri, Sep 06, 2013 at 01:16:45PM +0800, Weijie Yang wrote:
>> To avoid zswap store and reclaim functions called recursively,
>> use GFP_NOIO instead of GFP_KERNEL
>>
>> Signed-off-by: Weijie Yang
>
> I a
This patch series fix a few bugs in zswap based on Linux-3.11.
v1 --> v2
- free memory in zswap_frontswap_invalidate_area (in patch 1)
- fix whitespace corruption (line wrapping)
Corresponding mail thread: https://lkml.org/lkml/2013/8/18/59
These issues fixed/optimized are:
1.
To avoid zswap store and reclaim functions called recursively,
use GFP_NOIO instead of GFP_KERNEL
Signed-off-by: Weijie Yang
---
mm/zswap.c |6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/mm/zswap.c b/mm/zswap.c
index cc40e6a..3d05ed8 100644
--- a/mm/zswap.c
+++ b
add SetPageReclaim before __swap_writepage so that page can be moved to the
tail of the inactive list, which can avoid unnecessary page scanning as this
page was reclaimed by swap subsystem before.
Signed-off-by: Weijie Yang
---
mm/zswap.c |3 +++
1 file changed, 3 insertions(+)
diff --git
:
- check the refcount in fail path, free memory if it is not referenced.
- use ZSWAP_SWAPCACHE_FAIL instead of ZSWAP_SWAPCACHE_NOMEM as the fail path
can be not only caused by nomem but also by invalidate.
Signed-off-by: Weijie Yang
---
mm/zswap.c | 21 +
1 file changed, 13
zswap_tree is not freed when swapoff, and it got re-kmalloc in swapon,
so memory-leak occurs.
Modify: free memory of zswap_tree in zswap_frontswap_invalidate_area().
Signed-off-by: Weijie Yang
---
mm/zswap.c |4
1 file changed, 4 insertions(+)
diff --git a/mm/zswap.c b/mm/zswap.c
Thanks, Seth
On Thu, Oct 10, 2013 at 10:26 AM, Seth Jennings
wrote:
> On Thu, Oct 10, 2013 at 09:29:07AM +0800, Bob Liu wrote:
>> On 10/09/2013 10:40 PM, Seth Jennings wrote:
>> >
>> > The reason we never noticed this for zswap is that zswap has no
>> > dynamically allocated per-type resources.
On Wed, Sep 25, 2013 at 6:02 PM, Bob Liu wrote:
> On Wed, Sep 25, 2013 at 5:33 PM, Weijie Yang wrote:
>> On Wed, Sep 25, 2013 at 4:31 PM, Bob Liu wrote:
>>> On Wed, Sep 25, 2013 at 4:09 PM, Weijie Yang
>>> wrote:
>>>> I think I find a new issue, for
On Tue, Sep 24, 2013 at 9:03 AM, Minchan Kim wrote:
> On Mon, Sep 23, 2013 at 04:21:49PM +0800, Weijie Yang wrote:
> >
> > Modify:
> > - check the refcount in fail path, free memory if it is not referenced.
>
> Hmm, I don't like this because zswap refcount routi
On Thu, Sep 26, 2013 at 1:58 PM, Minchan Kim wrote:
> Hello Weigie,
>
> On Wed, Sep 25, 2013 at 05:33:43PM +0800, Weijie Yang wrote:
>> On Wed, Sep 25, 2013 at 4:31 PM, Bob Liu wrote:
>> > On Wed, Sep 25, 2013 at 4:09 PM, Weijie Yang
>> > wrote:
>> >&
On Thu, Sep 26, 2013 at 3:57 PM, Minchan Kim wrote:
> On Thu, Sep 26, 2013 at 03:26:33PM +0800, Weijie Yang wrote:
>> On Thu, Sep 26, 2013 at 1:58 PM, Minchan Kim wrote:
>> > Hello Weigie,
>> >
>> > On Wed, Sep 25, 2013 at 05:33:43PM +0800, Weijie Yang wrote
Two function declarations are absence if not define CONFIG_DEBUG_FS
in include/linux/debugfs.h
Signed-off-by: Weijie Yang
---
include/linux/debugfs.h | 12
1 file changed, 12 insertions(+)
diff --git a/include/linux/debugfs.h b/include/linux/debugfs.h
index 263489d..4d0b4d1
On Mon, Sep 23, 2013 at 10:06 AM, Bob Liu wrote:
>
> On 09/10/2013 12:29 AM, Seth Jennings wrote:
>> On Fri, Sep 06, 2013 at 01:16:45PM +0800, Weijie Yang wrote:
>>> add SetPageReclaim before __swap_writepage so that page can be moved to the
>>> tail of the
This patch series fix a few bugs in mm/zswap based on Linux-3.11.
v2 --> v3
- keep GFP_KERNEL flag
v1 --> v2
- free memory in zswap_frontswap_invalidate_area(in patch 1)
- fix whitespace corruption (line wrapping)
Corresponding mail thread: https://lkml.org/lkml/2
add SetPageReclaim before __swap_writepage so that page can be moved to the
tail of the inactive list, which can avoid unnecessary page scanning as this
page was reclaimed by swap subsystem before.
Signed-off-by: Weijie Yang
Reviewed-by: Bob Liu
Cc: Minchan Kim
Cc: sta...@vger.kernel.org
Acked
:
- check the refcount in fail path, free memory if it is not referenced.
- use ZSWAP_SWAPCACHE_FAIL instead of ZSWAP_SWAPCACHE_NOMEM as the fail path
can be not only caused by nomem but also by invalidate.
Signed-off-by: Weijie Yang
Reviewed-by: Bob Liu
Cc: Minchan Kim
Cc: sta
zswap_tree is not freed when swapoff, and it got re-kmalloc in swapon,
so memory-leak occurs.
Modify: free memory of zswap_tree in zswap_frontswap_invalidate_area().
Signed-off-by: Weijie Yang
Reviewed-by: Bob Liu
Cc: Minchan Kim
Cc: sta...@vger.kernel.org
Acked-by: Seth Jennings
---
mm
On Tue, Sep 24, 2013 at 9:11 AM, Minchan Kim wrote:
> On Mon, Sep 23, 2013 at 04:19:36PM +0800, Weijie Yang wrote:
>> This patch series fix a few bugs in mm/zswap based on Linux-3.11.
>>
>> v2 --> v3
>> - keep GFP_KERNEL flag
>
> Why do you drop this?
&g
I think I find a new issue, for integrity of this mail thread, I reply
to this mail.
It is a concurrence issue either, when duplicate store and reclaim
concurrentlly.
zswap entry x with offset A is already stored in zswap backend.
Consider the following scenario:
thread 0: reclaim entry x (get r
On Wed, Sep 25, 2013 at 4:31 PM, Bob Liu wrote:
> On Wed, Sep 25, 2013 at 4:09 PM, Weijie Yang wrote:
>> I think I find a new issue, for integrity of this mail thread, I reply
>> to this mail.
>>
>> It is a concurrence issue either, when duplicate store and reclaim
&g
I found a few bugs in zswap when I review Linux-3.11-rc5, and I have
also some questions about it, described as following:
BUG:
1. A race condition when reclaim a page
when a handle alloced from zbud, zbud considers this handle is used
validly by upper(zswap) and can be a candidate for reclaim.
Bu
2013/8/19 Minchan Kim :
> On Mon, Aug 19, 2013 at 10:17:38AM +0800, Bob Liu wrote:
>> Hi Weijie,
>>
>> On 08/19/2013 12:14 AM, Weijie Yang wrote:
>> > I found a few bugs in zswap when I review Linux-3.11-rc5, and I have
>> > also some questions about it
This patch series fix a few bugs in zswap based on Linux-3.11-rc6.
Corresponding mail thread see: lkml.org/lkml/2013/8/18/59 .
These issues fixed are:
1. memory leaks when re-swapon
2. potential problem which store and reclaim functions is called recursively
3. memory leaks when invalidate and r
zswap_tree is not freed when swapoff, and it got re-kzalloc in swapon,
memory leak occurs.
Add check statement in zswap_frontswap_init so that zswap_tree is
inited only once.
---
mm/zswap.c |5 +
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/mm/zswap.c b/mm/zswap.c
index
avoid zswap store and reclaim functions called recursively.
---
mm/zswap.c |6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/mm/zswap.c b/mm/zswap.c
index 1cf1c07..5f97f4f 100644
--- a/mm/zswap.c
+++ b/mm/zswap.c
@@ -427,7 +427,7 @@ static int zswap_get_swap_cache_page
Consider the following scenario:
thread 1: zswap reclaim entry x (get the refcount, but not call
zswap_get_swap_cache_page yet)
thread 0: zswap_frontswap_invalidate_page entry x (finished, entry x
and its zbud is not freed as its refcount != 0)
now, the swap_map[x] = 0
thread 1: zswap_get_swap_cach
add SetPageReclaim before __swap_writepage, so that page can be moved
to the tail of the inactive list,
which will avoid unnecessary page scanning as this page was reclaimed
by swap subsystem before.
---
mm/zswap.c |3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/mm/zswa
This patch series fix a few bugs in zswap based on Linux-3.11-rc6.
Corresponding mail thread see: lkml.org/lkml/2013/8/18/59 .
These issues fixed are:
1. memory leaks when re-swapon
2. potential problem which store and reclaim functions is called recursively
3. memory leaks when invalidate and
uddy) 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.
_list[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
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 |
s.
2. 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(-)
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
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
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:
>>
>&g
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 inconsistently,
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 --
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
uch as vmpressure_prio(), shrink_slab().
Signed-off-by: Weijie Yang
---
mm/vmscan.c |8 +++-
1 file changed, 7 insertions(+), 1 deletion(-)
mode change 100644 => 100755 mm/vmscan.c
diff --git a/mm/vmscan.c b/mm/vmscan.c
old mode 100644
new mode 100755
index a9c74b4..35879f0
--- a/mm
retry allocation is waste of time
and could cause a loop in __alloc_pages_slowpath().
This patch do not check compaction_ready() on promoted zones to avoid
the above situation, only set aborted_reclaim if the caller intended
zone is ready to compaction.
Signed-off-by: Weijie Yang
---
mm/vmscan.c
Set TIF_MEMDIE tsk_thread flag before send kill signal to the
selected thread. This is to fit a usual code sequence and avoid
potential race issue.
Signed-off-by: Weijie Yang
---
drivers/staging/android/lowmemorykiller.c |2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
mode change
On Thu, Feb 13, 2014 at 6:42 PM, Mel Gorman wrote:
> According to the swapon documentation
>
> Swap pages are allocated from areas in priority order,
> highest priority first. For areas with different priorities, a
> higher-priority area is exhausted before using a l
o swap A and B with
>>> >>> > >> > different priority
>>> >>> > >> > and A already has charged 19% long time ago and let's assume
>>> >>> > >> > that A swap is
>>> >>> > >> &
This patch series focus on some tiny and rare issues in swap subsystem.
These issues happen rarely, so it is just for the correctness of the code.
It firstly add some comments to try to make swap flag/lock usage in
swapfile.c more clear and readable,
and fix some rare issues in swap subsystem that
The swap flag/lock usage in swapfile.c is lack of clarity
and readability, some comments are not correct in other files.
Add some comments to try to make it more clear and readable.
Signed-off-by: Weijie Yang
---
include/linux/blkdev.h |4 ++-
mm/rmap.c |2 +-
mm
If a frontswap dup-store failed, it should invalidate the old page in
backend and return failure.
This patch add this missing handle. According to the comments of
__frontswap_store(), it should have been there.
Reported-by: changkun.li
Signed-off-by: Weijie Yang
---
mm/frontswap.c |4
If S_ISREG swapfile's blocksize > PAGE_SIZE, it is not suitable to be
a swapfile, because swap slot is fixed to PAGE_SIZE.
This patch check this situation and return -EINVAL if it happens.
Signed-off-by: Weijie Yang
---
mm/page_io.c |2 ++
1 file changed, 2 insertions(+)
diff --
econd period, so it is good
to performance.
Signed-off-by: Weijie Yang
---
mm/swapfile.c | 15 ++-
1 file changed, 2 insertions(+), 13 deletions(-)
diff --git a/mm/swapfile.c b/mm/swapfile.c
index 3023172..7332c3d 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -2637,19 +2637,8 @
implement its own shrinker if
there is a real-world need.
Signed-off-by: Weijie Yang
---
include/linux/frontswap.h |2 -
include/linux/swapfile.h |3 --
mm/frontswap.c| 116 -
mm/swapfile.c | 19 ++--
4 files
ops for detail.
This patch is just for a rare scenario, aim to correct of code.
Signed-off-by: Weijie Yang
---
include/linux/swapfile.h |1 +
mm/frontswap.c |7 ---
mm/swapfile.c| 20 +++-
3 files changed, 20 insertions(+), 8 deletions(-)
d
return -EBUSY for one swapon call.
As for S_ISREG swapfile, claim_swapfile() already prevent this scenario
by holding inode->i_mutex.
This patch is just for a rare scenario, aim to correct of code.
Signed-off-by: Weijie Yang
---
mm/swapfile.c |4 +++-
1 file changed, 3 insertions(+)
Signed-off-by: Weijie Yang
---
mm/swapfile.c | 14 +++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/mm/swapfile.c b/mm/swapfile.c
index 0a623a9..4d24158 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -1977,7 +1977,6 @@ SYSCALL_DEFINE1(swapoff, const char __user
- inode->i_flags &= ~S_SWAPFILE
This patch clear SWP_USED flag after all its resources freed, so that swapon
can reuse this swap_info by alloc_swap_info() safely.
Signed-off-by: Weijie Yang
---
mm/swapfile.c | 11 ++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git
Hi, Seth
Would you please check this issue? Thanks
On Mon, Nov 18, 2013 at 3:06 PM, Weijie Yang wrote:
> add cc Seth 's new email address.
>
> On Fri, Nov 8, 2013 at 6:28 PM, Bob Liu wrote:
>> On 11/08/2013 05:50 PM, changkun.li wrote:
>>> In zswap, store page
On Sat, Jan 11, 2014 at 9:11 AM, Andrew Morton
wrote:
> On Thu, 09 Jan 2014 13:39:55 +0800 Weijie Yang
> wrote:
>
>> swapoff clear swap_info's SWP_USED flag prematurely and free its resources
>> after that. A concurrent swapon will reuse this swap_info while its pre
On Mon, Jan 13, 2014 at 11:27 AM, Andrew Morton
wrote:
> On Mon, 13 Jan 2014 11:08:58 +0800 Weijie Yang
> wrote:
>
>> >> --- a/mm/swapfile.c
>> >> +++ b/mm/swapfile.c
>> >> @@ -1922,7 +1922,6 @@ SYSCALL_DEFINE1(swapoff, const char __user *,
>
On Mon, Jan 13, 2014 at 2:27 PM, Mateusz Guzik wrote:
> On Mon, Jan 13, 2014 at 11:51:42AM +0800, Weijie Yang wrote:
>> On Mon, Jan 13, 2014 at 11:27 AM, Andrew Morton
>> wrote:
>> > On Mon, 13 Jan 2014 11:08:58 +0800 Weijie Yang
>> > wrote:
>> >
>
On Tue, Jan 14, 2014 at 1:42 PM, Bob Liu wrote:
>
> On 01/14/2014 01:05 PM, Minchan Kim wrote:
>> On Tue, Jan 14, 2014 at 01:50:22PM +0900, Minchan Kim wrote:
>>> Hello Bob,
>>>
>>> On Tue, Jan 14, 2014 at 09:19:23AM +0800, Bob Liu wrote:
On 01/14/2014 07:35 AM, Minchan Kim wrote:
>
On Wed, Oct 16, 2013 at 1:19 AM, Hugh Dickins wrote:
> On Tue, 15 Oct 2013, Krzysztof Kozlowski wrote:
>> On Tue, 2013-10-15 at 02:59 -0700, Hugh Dickins wrote:
>> > On Mon, 14 Oct 2013, Krzysztof Kozlowski wrote:
>> >
>> > > Fix race between swapoff and swapon resulting in setting blocksize of
>>
On Thu, Oct 17, 2013 at 11:48 PM, Weijie Yang wrote:
> On Wed, Oct 16, 2013 at 1:19 AM, Hugh Dickins wrote:
>> On Tue, 15 Oct 2013, Krzysztof Kozlowski wrote:
>>> On Tue, 2013-10-15 at 02:59 -0700, Hugh Dickins wrote:
>>> > On Mon, 14 Oct 2013, Krzysztof Kozlowski
Hello Dan
On Thu, Nov 21, 2013 at 3:48 AM, Dan Streetman wrote:
> The changes in commit 0ab0abcf511545d1fddbe72a36b3ca73388ac937
> introduce a bug in writeback, if an entry is in use by load
> it will be evicted anyway, which isn't correct (technically,
> the code currently in zbud doesn't actual
Hello Dan
On Thu, Nov 21, 2013 at 3:47 AM, Dan Streetman wrote:
> Since zswap_rb_erase was added to the final (when refcount == 0)
> zswap_put_entry, there is no need to call zswap_rb_erase before
> calling zswap_put_entry.
>
> Signed-off-by: Dan Streetman
> ---
> mm/zswap.c | 5 -
> 1 file
On Thu, Nov 21, 2013 at 1:52 AM, Dan Streetman wrote:
> On Wed, Nov 20, 2013 at 12:33 PM, Vladimir Murzin wrote:
>> Hi Dan!
>>
>> On Wed, Nov 20, 2013 at 11:38:42AM -0500, Dan Streetman wrote:
>>> The "compressor" and "enabled" params are currently hidden,
>>> this changes them to read-only, so u
Hello Dan,
On Sat, Nov 23, 2013 at 6:10 AM, Dan Streetman wrote:
> Currently, zswap_entry_put removes the entry from its tree if
> the resulting refcount is 0. Several places in code put an
> entry's initial reference, but they also must remove the entry
> from its tree first, which makes the tr
Hello Dan,
On Sat, Nov 23, 2013 at 6:10 AM, Dan Streetman wrote:
> Currently, zswap is writeback cache; stored pages are not sent
> to swap disk, and when zswap wants to evict old pages it must
> first write them back to swap cache/disk manually. This avoids
> swap out disk I/O up front, but onl
On Fri, Oct 11, 2013 at 5:25 PM, Krzysztof Kozlowski
wrote:
> On Fri, 2013-10-11 at 10:23 +0800, Weijie Yang wrote:
>> I am sorry to interrupt this topic, but I found an tiny issue near that:
>>
>> we can not "set_blocksize(bdev, p->old_block_size);" at the end o
On Fri, Oct 11, 2013 at 3:13 PM, Minchan Kim wrote:
> On Thu, Sep 26, 2013 at 11:42:17AM +0800, Weijie Yang wrote:
>> On Tue, Sep 24, 2013 at 9:03 AM, Minchan Kim wrote:
>> > On Mon, Sep 23, 2013 at 04:21:49PM +0800, Weijie Yang wrote:
>> > >
>> > > Mo
On Sat, Oct 12, 2013 at 10:32 AM, Bob Liu wrote:
> On Thu, Sep 26, 2013 at 11:42 AM, Weijie Yang wrote:
>> On Tue, Sep 24, 2013 at 9:03 AM, Minchan Kim wrote:
>>> On Mon, Sep 23, 2013 at 04:21:49PM +0800, Weijie Yang wrote:
>>> >
>>> > Modify:
>
On Sat, Oct 12, 2013 at 10:50 AM, Bob Liu wrote:
> On Fri, Oct 11, 2013 at 3:13 PM, Minchan Kim wrote:
>> On Thu, Sep 26, 2013 at 11:42:17AM +0800, Weijie Yang wrote:
>>> On Tue, Sep 24, 2013 at 9:03 AM, Minchan Kim wrote:
>>> > On Mon, Sep 23, 2013 at 04:21
accepted, I will resent it instead of the previous refactor patch
please see below, Request For Comments, Thanks.
On Fri, Oct 11, 2013 at 3:13 PM, Minchan Kim wrote:
> On Thu, Sep 26, 2013 at 11:42:17AM +0800, Weijie Yang wrote:
> > On Tue, Sep 24, 2013 at 9:03 AM, Minchan Kim wrote:
> >
more decsription and resend it
as a RFC patch.
Thanks,
On Mon, Oct 14, 2013 at 8:31 AM, Minchan Kim wrote:
> Hello,
>
> On Sat, Oct 12, 2013 at 05:37:55PM +0800, Weijie Yang wrote:
>> Hi, all
>>
>> I thought out a new way to resolve this problem: use CAS instead of refcount
:
- check the refcount in fail path, free memory if it is not referenced.
- use ZSWAP_SWAPCACHE_FAIL instead of ZSWAP_SWAPCACHE_NOMEM as the fail path
can be not only caused by nomem but also by invalidate.
Signed-off-by: Weijie Yang
Reviewed-by: Bob Liu
Cc: Minchan Kim
Cc:
Acked-by: Seth
zswap_entry_find_get(), so that callers can use easily
in the following pattern:
zswap_entry_find_get
.../* do something */
zswap_entry_put
- to eliminate compile error, move some functions declaration
This patch is based on Minchan Kim 's idea and suggestion.
Signed-off-by: Weijie Yang
---
mm/zs
On Mon, Oct 28, 2013 at 8:21 PM, Rashika Kheria
wrote:
> This patch fixes the bug in reset_store caused by accessing NULL pointer.
> Hence, It introduces a check for bdev. It also removes unnecessary check
> of bdev for fsync_bdev().
>
> Signed-off-by: Rashika Kheria
> ---
>
> This revision fixes
On Mon, Oct 28, 2013 at 10:33 PM, Rashika Kheria
wrote:
>
>
>
> On Mon, Oct 28, 2013 at 7:15 PM, Weijie Yang
> wrote:
>>
>> On Mon, Oct 28, 2013 at 8:21 PM, Rashika Kheria
>> wrote:
>> > This patch fixes the bug in reset_store caused by accessing NULL
Hello, Rashika
On Wed, Oct 30, 2013 at 9:10 PM, Rashika Kheria
wrote:
> As suggested by Jerome Marchand "The code in reset_store get the block device
> (bdget_disk()) but it does not put it (bdput()) when it's done using it.
> The usage count is therefore incremented but never decremented."
>
> T
On Wed, Apr 23, 2014 at 3:55 AM, Andrew Morton
wrote:
> On Tue, 22 Apr 2014 11:14:02 +0800 Weijie Yang
> wrote:
>
>> we want to skip the logical block which is partially covered by
>> the discard bio, so check the remaining size and subtract it if
>> there is a ne
On Wed, Apr 23, 2014 at 11:08 AM, Joonsoo Kim wrote:
> On Wed, Apr 23, 2014 at 10:32:30AM +0800, Weijie Yang wrote:
>> On Wed, Apr 23, 2014 at 3:55 AM, Andrew Morton
>> wrote:
>> > On Tue, 22 Apr 2014 11:14:02 +0800 Weijie Yang
>> > wrote:
>> >
>&g
blocks.
However, with the current offset usage, it will discard the second
physical block and free its memory, which will cause filesystem breakdown.
This patch corrects the offset usage in zram_bio_discard.
Signed-off-by: Weijie Yang
Acked-by: Joonsoo Kim
---
drivers/block/zram/zram_drv.c
On Thu, Apr 24, 2014 at 3:31 PM, Sergey Senozhatsky
wrote:
> Hello Minchan,
>
> On (04/24/14 11:06), Minchan Kim wrote:
>> Hello,
>>
>> On Wed, Apr 23, 2014 at 04:41:15PM +0800, Weijie Yang wrote:
>> > We want to skip the physical block(PAGE_SIZE) which is p
On Fri, Apr 25, 2014 at 2:48 AM, Dan Streetman wrote:
> On Wed, Apr 23, 2014 at 6:34 AM, Mel Gorman wrote:
>> On Sat, Apr 12, 2014 at 05:00:53PM -0400, Dan Streetman wrote:
>>> Replace the singly-linked list tracking active, i.e. swapon'ed,
>>> swap_info_struct entries with a doubly-linked list u
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
On Sat, Apr 19, 2014 at 11:52 PM, Dan Streetman wrote:
> Add zs_shrink() and helper functions to zsmalloc. Update zsmalloc
> zs_create_pool() creation function to include ops param that provides
> an evict() function for use during shrinking. Update helper function
> fix_fullness_group() to alwa
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
On Thu, Feb 13, 2014 at 4:00 PM, David Rientjes wrote:
> On Thu, 13 Feb 2014, Weijie Yang wrote:
>
>> Set TIF_MEMDIE tsk_thread flag before send kill signal to the
>> selected thread. This is to fit a usual code sequence and avoid
>> potential race issue.
>>
>
On Fri, Feb 14, 2014 at 12:10 AM, Rik van Riel wrote:
> On 02/12/2014 09:39 PM, Weijie Yang wrote:
>
>> --- a/mm/vmscan.c
>> +++ b/mm/vmscan.c
>> @@ -2298,14 +2298,17 @@ static bool shrink_zones(struct zonelist *zonelist,
>> struct scan_control *sc)
>>
Set TIF_MEMDIE tsk_thread flag before send kill signal to the
selected thread. This is to fit a usual code sequence and avoid
potential race issue.
Signed-off-by: Weijie Yang
---
drivers/staging/android/lowmemorykiller.c |2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a
uch as vmpressure_prio(), shrink_slab().
Signed-off-by: Weijie Yang
---
Changes since v1:
- use orig_mask to record the caller's orininal mask and restore
it after finishing scan, according to Riel's suggestion.
V1: https://lkml.org/lkml/2014/2/12/764
mm/vmscan.c |
retry allocation is waste of time
and could cause a loop in __alloc_pages_slowpath().
This patch do not check compaction_ready() on promoted zones to avoid
the above situation, only set aborted_reclaim if the caller intended
zone is ready to compaction.
Acked-by: Rik van Riel
Signed-off-by: Weijie
On Fri, Feb 14, 2014 at 6:17 PM, Mel Gorman wrote:
> On Thu, Feb 13, 2014 at 11:58:05PM +0800, Weijie Yang wrote:
>> On Thu, Feb 13, 2014 at 6:42 PM, Mel Gorman wrote:
>> > According to the swapon documentation
>> >
>> > Swap pages are alloc
In putback_inactive_pages() and move_active_pages_to_lru(),
lruvec is already an input parameter and pages are all from this lruvec,
therefore there is no need to call mem_cgroup_page_lruvec() in loop.
Signed-off-by: Weijie Yang
---
mm/vmscan.c |3 ---
1 file changed, 3 deletions(-)
diff
On Sun, Feb 16, 2014 at 12:00 PM, Hugh Dickins wrote:
> On Sun, 16 Feb 2014, Weijie Yang wrote:
>
>> In putback_inactive_pages() and move_active_pages_to_lru(),
>> lruvec is already an input parameter and pages are all from this lruvec,
>> therefore there is no need to cal
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
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
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
On Tue, Feb 4, 2014 at 12:20 PM, Hugh Dickins wrote:
> On Mon, 3 Feb 2014, Andrew Morton wrote:
>> On Mon, 27 Jan 2014 18:03:04 +0800 Weijie Yang
>> wrote:
>>
>> > When swapon the same S_ISBLK blockdev concurrent, the allocated two
>> > swap_info co
On Sat, Apr 19, 2014 at 11:52 PM, Dan Streetman wrote:
> In order to allow zswap users to choose between zbud and zsmalloc for
> the compressed storage pool, this patch set adds a new api "zpool" that
> provides an interface to both zbud and zsmalloc. Only a minor change
> to zbud's interface w
we want to skip the logical block which is partially covered by
the discard bio, so check the remaining size and subtract it if
there is a need to goto the next logical block.
This patch corrects the offset usage in zram_bio_discard.
Signed-off-by: Weijie Yang
---
drivers/block/zram/zram_drv.c
1 - 100 of 145 matches
Mail list logo