All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bart Van Assche <Bart.VanAssche@sandisk.com>
To: "dm-devel@redhat.com" <dm-devel@redhat.com>,
	Damien Le Moal <Damien.LeMoal@wdc.com>
Cc: "hch@lst.de" <hch@lst.de>
Subject: Re: [PATCH 10/10] dm-zoned: Drive-managed zoned block device target
Date: Fri, 28 Apr 2017 21:14:25 +0000	[thread overview]
Message-ID: <1493414065.2767.23.camel@sandisk.com> (raw)
In-Reply-To: <20170421035558.2657-11-damien.lemoal@wdc.com>

On Fri, 2017-04-21 at 12:55 +0900, damien.lemoal@wdc.com wrote:
> +static void dmz_shrink_mblock_cache(struct dmz_target *dmz, bool idle)
> +{
> +       struct dmz_mblock *mblk;
> +       unsigned int nr_mblks;
> +
> +       if (!dmz->max_nr_mblks)
> +               return;
> +
> +       if (idle)
> +               nr_mblks = dmz->min_nr_mblks;
> +       else
> +               nr_mblks = dmz->max_nr_mblks;
> +
> +       while (atomic_read(&dmz->nr_mblks) > nr_mblks &&
> +              !list_empty(&dmz->mblk_lru_list)) {
> +               mblk = list_first_entry(&dmz->mblk_lru_list,
> +                                       struct dmz_mblock, link);
> +               list_del_init(&mblk->link);
> +               rb_erase(&mblk->node, &dmz->mblk_rbtree);
> +               dmz_free_mblock(dmz, mblk);
> +       }
> +}

(off-list)

Hello Damien,

Is mblk_lru_list perhaps a cache that should be freed under memory pressure?
If so, if you repost this patch series please add a shrinker (struct shrinker
+ register_shrinker()) such that this memory can be freed if memory pressure
becomes too high.

Thanks,

Bart.

  reply	other threads:[~2017-04-28 21:14 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-21  3:55 [PATCH 00/10] dm: zoned block device support damien.lemoal
2017-04-21  3:55 ` [PATCH 01/10] dm-table: Introduce DM_TARGET_ZONED_HM feature damien.lemoal
2017-04-21  3:55 ` [PATCH 02/10] dm-table: Check device area zone alignment damien.lemoal
2017-04-21  3:55 ` [PATCH 03/10] dm-table: Check block devices zone model compatibility damien.lemoal
2017-04-21  3:55   ` damien.lemoal
2017-04-29  3:15   ` Bart Van Assche
2017-04-21  3:55 ` [PATCH 04/10] dm: Fix REQ_OP_ZONE_RESET bio handling damien.lemoal
2017-04-21  3:55 ` [PATCH 05/10] dm: Fix REQ_OP_ZONE_REPORT " damien.lemoal
2017-04-21  3:55 ` [PATCH 06/10] dm: Introduce dm_remap_zone_report() damien.lemoal
2017-04-21  3:55 ` [PATCH 07/10] dm-flakey: Add support for zoned block devices damien.lemoal
2017-04-21  3:55 ` [PATCH 08/10] dm-linear: " damien.lemoal
2017-04-21  3:55 ` [PATCH 09/10] dm-kcopyd: Add sequential write feature damien.lemoal
2017-04-21  3:55 ` [PATCH 10/10] dm-zoned: Drive-managed zoned block device target damien.lemoal
2017-04-28 21:14   ` Bart Van Assche [this message]
2017-04-24  6:24 ` [PATCH 00/10] dm: zoned block device support Hannes Reinecke
2017-04-24  6:24   ` Hannes Reinecke
2017-04-24  7:52   ` Damien Le Moal
2017-04-27  4:22 ` Damien Le Moal

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=1493414065.2767.23.camel@sandisk.com \
    --to=bart.vanassche@sandisk.com \
    --cc=Damien.LeMoal@wdc.com \
    --cc=dm-devel@redhat.com \
    --cc=hch@lst.de \
    /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.