From: Bob Peterson <rpeterso@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [GFS2 PATCH 06/12] gfs2: Create transaction for inodes with i_nlink != 0
Date: Thu, 27 Aug 2020 09:00:11 -0400 (EDT) [thread overview]
Message-ID: <504794288.14461492.1598533211696.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <CAHc6FU4u5NW3FYwTz0E4zVp5KWejtUc67YXjMXJNmL=wJfuHjg@mail.gmail.com>
----- Original Message -----
> On Fri, Aug 21, 2020 at 7:33 PM Bob Peterson <rpeterso@redhat.com> wrote:
> > Before this patch, function gfs2_evict_inode would check if i_nlink
> > was non-zero, and if so, go to label out. The problem is, the evicted
> > file may still have outstanding pages that need invalidating, but
> > the call to truncate_inode_pages_final at label out doesn't start a
> > transaction. It needs a transaction in order to write revokes for any
> > pages it has to invalidate.
>
> This is only true for jdata inodes though, right? If so, I'd rather
> just create transactions in the jdata case.
The truncate_inode_pages_final() for i_data is only for jdata, which
includes directories for their hash tables. However, for regular files,
evict's call to gfs2_glock_put_eventually() has the potential to be the
last put for the inode's glock (in a race), which might still have pages
attached (metamapping). I firmly believe this is our "nrpages" bug I've been
chasing, but I haven't proven it yet because it's very hard to recreate.
Afaik, some of these unresolved metadata pages may still need revokes, and
we still need a transaction to do that, even if the dinode still has links.
The "nrpages" problem always seems to involve the system quotas file,
probably because it's jdata, but imagine a directory with a large hash
table, which is modified, then is quickly evicted (without being deleted).
It wasn't that long ago I was working on a patch to take glock reference
even sooner than we did for f4e2f5e1a527ce58fc9f85145b03704779a3123e.
I titled the patch "grab glock reference as early as possible in transactions
but it was never pushed anywhere because it added a new atomic to the
glock. It may be an alternative solution to the problem. My comments on
that patch were:
Before this patch, an additional glock reference was taken when
the bufdata element, bd, was revoked. That's not early enough
because the caller who created the bd (via trans_add_meta) may
have already come and gone with the bd still not revoked (but
in the ail).
This patch takes the glock reference earlier in the process, when
the first bd element is allocated for a glock. It queues the glock
reference to be put when the last bd element for the glock is freed.
To this end, a new atomic glock field, gl_bd_count, keeps count.
Regards,
Bob Peterson
next prev parent reply other threads:[~2020-08-27 13:00 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-21 17:33 [Cluster-devel] [GFS2 PATCH 00/12] gfs2: jdata patch collection revisited Bob Peterson
2020-08-21 17:33 ` [Cluster-devel] [GFS2 PATCH 01/12] gfs2: rename gfs2_write_full_page to gfs2_write_jdata_page, remove parm Bob Peterson
2020-08-21 17:33 ` [Cluster-devel] [GFS2 PATCH 02/12] gfs2: add missing log_blocks trace points in gfs2_write_revokes Bob Peterson
2020-08-21 17:33 ` [Cluster-devel] [GFS2 PATCH 03/12] gfs2: enhance log_blocks trace point to show log blocks free Bob Peterson
2020-08-21 17:33 ` [Cluster-devel] [GFS2 PATCH 04/12] gfs2: Wipe jdata and ail1 in gfs2_journal_wipe, formerly gfs2_meta_wipe Bob Peterson
2020-08-21 17:33 ` [Cluster-devel] [GFS2 PATCH 05/12] gfs2: Calculate number of revokes during evict Bob Peterson
2020-08-27 6:00 ` Andreas Gruenbacher
2020-08-21 17:33 ` [Cluster-devel] [GFS2 PATCH 06/12] gfs2: Create transaction for inodes with i_nlink != 0 Bob Peterson
2020-08-27 6:00 ` Andreas Gruenbacher
2020-08-27 7:41 ` Steven Whitehouse
2020-08-27 13:00 ` Bob Peterson [this message]
2020-08-21 17:33 ` [Cluster-devel] [GFS2 PATCH 07/12] gfs2: make gfs2_ail1_empty_one return the count of active items Bob Peterson
2020-08-27 6:00 ` Andreas Gruenbacher
2020-08-27 16:45 ` Bob Peterson
2020-08-21 17:33 ` [Cluster-devel] [GFS2 PATCH 08/12] gfs2: don't lock sd_ail_lock in gfs2_releasepage Bob Peterson
2020-08-21 17:33 ` [Cluster-devel] [GFS2 PATCH 09/12] gfs2: Only set PageChecked if we have a transaction Bob Peterson
2020-08-21 17:33 ` [Cluster-devel] [GFS2 PATCH 10/12] gfs2: simplify gfs2_block_map Bob Peterson
2020-08-21 17:33 ` [Cluster-devel] [GFS2 PATCH 11/12] gfs2: Ignore journal log writes for jdata holes Bob Peterson
2020-08-21 17:33 ` [Cluster-devel] [GFS2 PATCH 12/12] gfs2: add some much needed cleanup for log flushes that fail Bob Peterson
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=504794288.14461492.1598533211696.JavaMail.zimbra@redhat.com \
--to=rpeterso@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 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).