All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bob Liu <bob.liu@oracle.com>
To: Olav Haugan <ohaugan@codeaurora.org>
Cc: Minchan Kim <minchan@kernel.org>,
	sjenning@linux.vnet.ibm.com, linux-kernel@vger.kernel.org,
	linux-mm@kvack.org
Subject: Re: zram/zsmalloc issues in very low memory conditions
Date: Sat, 02 Nov 2013 10:50:53 +0800	[thread overview]
Message-ID: <5274688D.7050902@oracle.com> (raw)
In-Reply-To: <52744E8F.3040405@codeaurora.org>

Hi Olav,

On 11/02/2013 08:59 AM, Olav Haugan wrote:

> 
> I tried the above suggestion but it does not seem to have any noticeable
> impact. The system is still trying to swap out at a very high rate after
> zram reported failure to swap out. The error logging is actually so much
> that my system crashed due to excessive logging (we have a watchdog that
> is not getting pet because the kernel is busy logging kernel messages).
> 

I have a question that why the low memory killer didn't get triggered in
this situation?
Is it possible to set the LMK a bit more aggressive?

> There isn't anything that can be set to tell the fs layer to back off
> completely for a while (congestion control)?
> 

The other way I think might fix your issue is the same as your mentioned
in your previous email.
Set the congested bit for swap device also.
Like:

diff --git a/drivers/staging/zram/zram_drv.c
b/drivers/staging/zram/zram_drv.c
index 91d94b5..c4fc63e 100644
--- a/drivers/staging/zram/zram_drv.c
+++ b/drivers/staging/zram/zram_drv.c
@@ -474,6 +474,7 @@ static int zram_bvec_write(struct zram *zram, struct
bio_vec *bvec, u32 index,
        if (!handle) {
                pr_info("Error allocating memory for compressed page:
%u, size=%zu\n",
                        index, clen);
+               blk_set_queue_congested(zram->disk->queue, BLK_RW_ASYNC);
                ret = -ENOMEM;
                goto out;
        }
diff --git a/mm/vmscan.c b/mm/vmscan.c
index 8ed1b77..1c790ee 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -394,8 +394,6 @@ static inline int is_page_cache_freeable(struct page
*page)
 static int may_write_to_queue(struct backing_dev_info *bdi,
                              struct scan_control *sc)
 {
-       if (current->flags & PF_SWAPWRITE)
-               return 1;

--------------------------------------------------------------

For the update of the congested state of zram, I think you can clear it
from use space eg. after LMK triggered and reclaimed some memory.

Of course this depends on zram driver to export a sysfs node like
"/sys/block/zram0/clear_congested".

-- 
Regards,
-Bob

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

WARNING: multiple messages have this Message-ID (diff)
From: Bob Liu <bob.liu@oracle.com>
To: Olav Haugan <ohaugan@codeaurora.org>
Cc: Minchan Kim <minchan@kernel.org>,
	sjenning@linux.vnet.ibm.com, linux-kernel@vger.kernel.org,
	linux-mm@kvack.org
Subject: Re: zram/zsmalloc issues in very low memory conditions
Date: Sat, 02 Nov 2013 10:50:53 +0800	[thread overview]
Message-ID: <5274688D.7050902@oracle.com> (raw)
In-Reply-To: <52744E8F.3040405@codeaurora.org>

Hi Olav,

On 11/02/2013 08:59 AM, Olav Haugan wrote:

> 
> I tried the above suggestion but it does not seem to have any noticeable
> impact. The system is still trying to swap out at a very high rate after
> zram reported failure to swap out. The error logging is actually so much
> that my system crashed due to excessive logging (we have a watchdog that
> is not getting pet because the kernel is busy logging kernel messages).
> 

I have a question that why the low memory killer didn't get triggered in
this situation?
Is it possible to set the LMK a bit more aggressive?

> There isn't anything that can be set to tell the fs layer to back off
> completely for a while (congestion control)?
> 

The other way I think might fix your issue is the same as your mentioned
in your previous email.
Set the congested bit for swap device also.
Like:

diff --git a/drivers/staging/zram/zram_drv.c
b/drivers/staging/zram/zram_drv.c
index 91d94b5..c4fc63e 100644
--- a/drivers/staging/zram/zram_drv.c
+++ b/drivers/staging/zram/zram_drv.c
@@ -474,6 +474,7 @@ static int zram_bvec_write(struct zram *zram, struct
bio_vec *bvec, u32 index,
        if (!handle) {
                pr_info("Error allocating memory for compressed page:
%u, size=%zu\n",
                        index, clen);
+               blk_set_queue_congested(zram->disk->queue, BLK_RW_ASYNC);
                ret = -ENOMEM;
                goto out;
        }
diff --git a/mm/vmscan.c b/mm/vmscan.c
index 8ed1b77..1c790ee 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -394,8 +394,6 @@ static inline int is_page_cache_freeable(struct page
*page)
 static int may_write_to_queue(struct backing_dev_info *bdi,
                              struct scan_control *sc)
 {
-       if (current->flags & PF_SWAPWRITE)
-               return 1;

--------------------------------------------------------------

For the update of the congested state of zram, I think you can clear it
from use space eg. after LMK triggered and reclaimed some memory.

Of course this depends on zram driver to export a sysfs node like
"/sys/block/zram0/clear_congested".

-- 
Regards,
-Bob

  reply	other threads:[~2013-11-02  2:51 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-23 21:51 zram/zsmalloc issues in very low memory conditions Olav Haugan
2013-10-23 21:51 ` Olav Haugan
2013-10-23 22:14 ` Luigi Semenzato
2013-10-23 22:17 ` Luigi Semenzato
2013-10-23 22:17   ` Luigi Semenzato
2013-10-24  0:55 ` Bob Liu
2013-10-24  0:55   ` Bob Liu
2013-10-25  0:35   ` Olav Haugan
2013-10-25  0:35     ` Olav Haugan
2013-10-25  1:12     ` Luigi Semenzato
2013-10-25  1:12       ` Luigi Semenzato
2013-10-31 23:34       ` Olav Haugan
2013-10-31 23:34         ` Olav Haugan
2013-11-01  0:25         ` Luigi Semenzato
2013-11-01  0:27         ` Luigi Semenzato
2013-11-01  0:27           ` Luigi Semenzato
2013-11-02  7:40           ` Stephen Barber
2013-11-02  7:40             ` Stephen Barber
2013-11-01  0:35         ` Bob Liu
2013-11-01  0:35           ` Bob Liu
2013-10-25  2:59     ` Bob Liu
2013-10-25  2:59       ` Bob Liu
2013-10-24 10:42 ` Weijie Yang
2013-10-24 10:42   ` Weijie Yang
2013-10-25  9:19 ` Minchan Kim
2013-10-25  9:19   ` Minchan Kim
2013-11-02  0:59   ` Olav Haugan
2013-11-02  0:59     ` Olav Haugan
2013-11-02  2:50     ` Bob Liu [this message]
2013-11-02  2:50       ` Bob Liu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5274688D.7050902@oracle.com \
    --to=bob.liu@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=minchan@kernel.org \
    --cc=ohaugan@codeaurora.org \
    --cc=sjenning@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.