public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Dave Chinner <david@fromorbit.com>
Cc: xfs@oss.sgi.com
Subject: Re: [PATCH 6/7] libxfs: keep unflushable buffers off the cache MRUs
Date: Mon, 8 Feb 2016 02:06:36 -0800	[thread overview]
Message-ID: <20160208100636.GA27683@infradead.org> (raw)
In-Reply-To: <1454627108-19036-7-git-send-email-david@fromorbit.com>

> --- a/include/cache.h
> +++ b/include/cache.h
> @@ -51,6 +51,7 @@ enum {
>  #define CACHE_BASE_PRIORITY	0
>  #define CACHE_PREFETCH_PRIORITY	8
>  #define CACHE_MAX_PRIORITY	15
> +#define CACHE_DIRTY_PRIORITY	(CACHE_MAX_PRIORITY + 1)

Sizing arrays based on, and iterating up to CACHE_DIRTY_PRIORITY seems
rather odd.  Maybe add a new

#define CACHE_NR_PRIORITIES		CACHE_DIRTY_PRIORITY

and a comment explaining the magic to make it more obvious?

> +cache_move_to_dirty_mru(
> +	struct cache		*cache,
> +	struct cache_node	*node)
> +{
> +	struct cache_mru	*mru;
> +
> +	mru = &cache->c_mrus[CACHE_DIRTY_PRIORITY];
> +
> +	pthread_mutex_lock(&mru->cm_mutex);
> +	node->cn_priority = CACHE_DIRTY_PRIORITY;
> +	list_move(&node->cn_mru, &mru->cm_list);
> +	mru->cm_count++;
> +	pthread_mutex_unlock(&mru->cm_mutex);
> +}

Maybe it would better to just do a list_add here and leave the
list_del to the caller to avoid needing to nest two different
cm_mutex instances.

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

  parent reply	other threads:[~2016-02-08 10:06 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-04 23:05 [PATCH 1/7 v2] repair: big broken filesystems cause pain Dave Chinner
2016-02-04 23:05 ` [PATCH 1/7] repair: parallelise phase 7 Dave Chinner
2016-02-08  8:55   ` Christoph Hellwig
2016-02-09  0:12     ` Dave Chinner
2016-02-04 23:05 ` [PATCH 2/7] repair: parallelise uncertin inode processing in phase 3 Dave Chinner
2016-02-08  8:58   ` Christoph Hellwig
2016-02-04 23:05 ` [PATCH 3/7] libxfs: directory node splitting does not have an extra block Dave Chinner
2016-02-05 14:20   ` Brian Foster
2016-02-08  9:00   ` Christoph Hellwig
2016-02-04 23:05 ` [PATCH 4/7] libxfs: don't discard dirty buffers Dave Chinner
2016-02-08  9:03   ` Christoph Hellwig
2016-02-04 23:05 ` [PATCH 5/7] libxfs: don't repeatedly shake unwritable buffers Dave Chinner
2016-02-08  9:03   ` Christoph Hellwig
2016-02-04 23:05 ` [PATCH 6/7] libxfs: keep unflushable buffers off the cache MRUs Dave Chinner
2016-02-05 14:22   ` Brian Foster
2016-02-08 10:06   ` Christoph Hellwig [this message]
2016-02-08 19:54     ` Dave Chinner
2016-02-04 23:05 ` [PATCH 7/7] libxfs: reset dirty buffer priority on lookup Dave Chinner
2016-02-05 14:23   ` Brian Foster
2016-02-08 10:08   ` Christoph Hellwig

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=20160208100636.GA27683@infradead.org \
    --to=hch@infradead.org \
    --cc=david@fromorbit.com \
    --cc=xfs@oss.sgi.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox