From: "Theodore Tso" <tytso@mit.edu>
To: Andreas Dilger <adilger@dilger.ca>
Cc: Ext4 Developers List <linux-ext4@vger.kernel.org>
Subject: Re: [PATCH -v2] ext4: enable scoped NOFS when starting a handle in nojournal mode
Date: Mon, 20 Jul 2026 12:03:46 -0400 [thread overview]
Message-ID: <al5FynB8Lc9YqB8p@mit.edu> (raw)
In-Reply-To: <F1DF796F-992C-439F-B889-9F62DD22ED9E@dilger.ca>
On Thu, Jul 16, 2026 at 01:45:51PM -0500, Andreas Dilger wrote:
> If you wanted to avoid an allocation for each nojournal handle on 64-bit
> systems, you could put a magic number in the high 32 bits of the handle
> pointer (which is unlikely to conflict with real memory addresses),
> and the PF_* flags in the low 32 bits.
That's an optimization we could do later, if we think the complexity
overhead is worth it.
> > @@ -513,6 +513,7 @@ struct jbd2_journal_handle
> > unsigned int h_sync: 1;
> > unsigned int h_reserved: 1;
> > unsigned int h_aborted: 1;
> > + unsigned int h_invalid: 1;
> > unsigned int h_type: 8;
> > unsigned int h_line_no: 16;
>
> Not sure if it makes much difference, but should h_line_no be aligned on a
> 16-bit offset and h_type aligned on an 8-bit offset by adding an
> "unsigned int h_unused:4" field before h_type, or reorder them so the 1-bit
> fields are at the end? That would allow the integer fields to be accessed
> directly rather than also having to shift them.
Both gcc and clang support the extension of supporting bitfields on
char and shorts, so we can do this:
- unsigned int h_sync: 1;
- unsigned int h_reserved: 1;
- unsigned int h_aborted: 1;
- unsigned int h_invalid: 1;
- unsigned int h_type: 8;
- unsigned int h_line_no: 16;
+ unsigned char h_sync: 1;
+ unsigned char h_reserved: 1;
+ unsigned char h_aborted: 1;
+ unsigned char h_invalid: 1;
+ unsigned char h_type;
+ unsigned short h_line_no;
- Ted
prev parent reply other threads:[~2026-07-20 16:04 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-16 14:48 [PATCH -v2] ext4: enable scoped NOFS when starting a handle in nojournal mode Theodore Ts'o
2026-07-16 19:45 ` Andreas Dilger
2026-07-20 16:03 ` Theodore Tso [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=al5FynB8Lc9YqB8p@mit.edu \
--to=tytso@mit.edu \
--cc=adilger@dilger.ca \
--cc=linux-ext4@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 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.