All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Snitzer <snitzer@redhat.com>
To: Mikulas Patocka <mpatocka@redhat.com>
Cc: dm-devel@redhat.com
Subject: Re: dm-bufio: check watermark periodically each 30 seconds
Date: Mon, 1 May 2017 15:51:05 -0400	[thread overview]
Message-ID: <20170501195104.GA14140@redhat.com> (raw)
In-Reply-To: <alpine.LRH.2.02.1704301733270.25063@file01.intranet.prod.int.rdu2.redhat.com>

On Sun, Apr 30 2017 at  5:34pm -0400,
Mikulas Patocka <mpatocka@redhat.com> wrote:

> dm-bufio checks a watermark when it allocates a new buffer in the function
> __bufio_new. However, it doesn't check the watermark when the user changes
> the value /sys/module/dm_bufio/parameters/max_cache_size_bytes.
> 
> This may result in a problem - if the watermark is high enough so that all
> possible buffers are allocated and if the user lowers the value
> "max_cache_size_bytes", the watermark will never be checked against the
> new value because no new buffer would be allocated.
> 
> This patch changes the function __evict_old_buffers so that it checks the
> watermark. __evict_old_buffers is called every 30 seconds, so if the user
> lowes "max_cache_size_bytes", dm-bufio will react to this change within
> 30 seconds and decrease memory consumption.
> 
> This patch requires the previous patch "dm-bufio: avoid a possible
> deadlock due to lock ordering" to be applied. Applying this patch without
> the previous patch would result in a deadlock.
> 
> Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
> Cc: stable@vger.kernel.org

I've applied the 2 stable@ fixes for 4.12 but the optimizations will
have to wait for 4.13 (the 4.12 merge window is already open, I need to
draw a line in the sand now).

Mike

      reply	other threads:[~2017-05-01 19:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-30 21:34 [PATCH] dm-bufio: check watermark periodically each 30 seconds Mikulas Patocka
2017-05-01 19:51 ` Mike Snitzer [this message]

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=20170501195104.GA14140@redhat.com \
    --to=snitzer@redhat.com \
    --cc=dm-devel@redhat.com \
    --cc=mpatocka@redhat.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.