From: Lucas Stach <dev@lynxeye.de>
To: Dave Chinner <david@fromorbit.com>
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH 1/2] xfs: use rhashtable to track buffer cache
Date: Sat, 22 Oct 2016 20:01:49 +0200 [thread overview]
Message-ID: <1477159309.2070.14.camel@lynxeye.de> (raw)
In-Reply-To: <20161018221849.GD23194@dastard>
Am Mittwoch, den 19.10.2016, 09:18 +1100 schrieb Dave Chinner:
> On Tue, Oct 18, 2016 at 10:14:12PM +0200, Lucas Stach wrote:
> >
[ Snipped lots of comments that are all valid and will be taken care of
in V2]
> > +static const struct rhashtable_params xfs_buf_hash_params = {
> > + .min_size = 4096,
> > + .nelem_hint = 3072,
>
> What does this hint do?
>
It's the initial sizing of the hash. The shrinker will not resize the
hash below min_size, but if the nelem_hint isn't given that hash will
start out really small. Maybe that's just the behavior we want, will
have to rethink this.
> >
> > + .key_len = sizeof(xfs_daddr_t),
> > + .key_offset = offsetof(struct xfs_buf, b_bn),
> > + .head_offset = offsetof(struct xfs_buf, b_rhash_head),
> > + .automatic_shrinking = true,
>
> Hmmm - so memory pressure is going to cause this hash to be resized
> as the shrinker frees buffers. That, in turn, will cause the
> rhashtable code to run GFP_KERNEL allocations, which could result in
> it re-entering the shrinker and trying to free buffers which will
> modify the hash table.
>
> That doesn't seem like a smart thing to do to me - it seems to me
> like it introduces a whole new avenue for memory reclaim deadlocks
> (or, at minimum, lockdep false positives) to occur....
>
Shrinking of the hash table is done in a worker, so I don't see the
direct chain you are describing above.
[more valid remarks snipped]
Regards,
Lucas
next prev parent reply other threads:[~2016-10-22 18:01 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-18 20:14 [PATCH 0/2] XFS buffer cache scalability improvements Lucas Stach
2016-10-18 20:14 ` [PATCH 1/2] xfs: use rhashtable to track buffer cache Lucas Stach
2016-10-18 22:18 ` Dave Chinner
2016-10-22 18:01 ` Lucas Stach [this message]
2016-10-24 2:15 ` Dave Chinner
2016-10-24 11:47 ` Lucas Stach
2016-10-19 1:15 ` Dave Chinner
2016-10-18 20:14 ` [PATCH 2/2] xfs: switch buffer cache entries to RCU freeing Lucas Stach
2016-10-18 22:43 ` Dave Chinner
2016-10-22 18:52 ` Lucas Stach
2016-10-24 2:37 ` Dave Chinner
2016-10-18 21:21 ` [PATCH 0/2] XFS buffer cache scalability improvements Dave Chinner
2016-10-22 17:51 ` Lucas Stach
2016-11-10 23:02 ` Dave Chinner
2016-12-02 21:54 ` Lucas Stach
2016-12-04 21:36 ` Dave Chinner
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=1477159309.2070.14.camel@lynxeye.de \
--to=dev@lynxeye.de \
--cc=david@fromorbit.com \
--cc=linux-xfs@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).