public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Qu Wenruo <quwenruo.btrfs@gmx.com>
To: dsterba@suse.cz, Qu Wenruo <wqu@suse.com>,
	Christoph Hellwig <hch@lst.de>,
	Josef Bacik <josef@toxicpanda.com>,
	David Sterba <dsterba@suse.com>,
	linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 1/3] btrfs: simplify WQ_HIGHPRI handling in struct btrfs_workqueue
Date: Sat, 23 Apr 2022 06:58:23 +0800	[thread overview]
Message-ID: <6bd7fdf2-62eb-d109-44bb-21a9eed09d3b@gmx.com> (raw)
In-Reply-To: <20220422210525.GL18596@twin.jikos.cz>



On 2022/4/23 05:05, David Sterba wrote:
> On Mon, Apr 18, 2022 at 04:03:43PM +0800, Qu Wenruo wrote:
>>> -struct __btrfs_workqueue {
>>> +struct btrfs_workqueue {
>>>    	struct workqueue_struct *normal_wq;
>>
>> I guess we can also rename @normal_wq here, as there is only one wq in
>> each btrfs_workqueue, no need to distinguish them in btrfs_workqueue.
>
> Yeah now the 'normal_' prefix does not make sense.
>
>> And since we're here, doing a pahole optimization would also be a good
>> idea (can be done in a sepearate patchset).
>>
>> Especially there is a huge 16 bytes hole between @ordered_list and
>> @list_lock.
>
> On a release build the packing is good, I don't see any holes there:

Oh, I'm using debug builds, no wonder.

Just by my pure curiosity, there seems to be some topic on randomizing
kernel structures (definitely not all, that would not only screw up
on-disk format but also various interface).

But for structures only used inside one module, and not exposed, is
there any attribute to allow compiler to do the optimization at runtime?

Thanks,
Qu
>
> struct btrfs_work {
>          btrfs_func_t               func;                 /*     0     8 */
>          btrfs_func_t               ordered_func;         /*     8     8 */
>          btrfs_func_t               ordered_free;         /*    16     8 */
>          struct work_struct         normal_work;          /*    24    32 */
>          struct list_head           ordered_list;         /*    56    16 */
>          /* --- cacheline 1 boundary (64 bytes) was 8 bytes ago --- */
>          struct btrfs_workqueue *   wq;                   /*    72     8 */
>          long unsigned int          flags;                /*    80     8 */
>
>          /* size: 88, cachelines: 2, members: 7 */
>          /* last cacheline: 24 bytes */
> };
>
> The fs_info structure grew a bit but it's a large one and there's still
> enough space before it hits 4K.

  reply	other threads:[~2022-04-22 23:20 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-18  4:43 btrfs_workqueue cleanups Christoph Hellwig
2022-04-18  4:43 ` [PATCH 1/3] btrfs: simplify WQ_HIGHPRI handling in struct btrfs_workqueue Christoph Hellwig
2022-04-18  8:03   ` Qu Wenruo
2022-04-22 21:05     ` David Sterba
2022-04-22 22:58       ` Qu Wenruo [this message]
2022-04-23  5:45       ` Christoph Hellwig
2022-04-18  4:43 ` [PATCH 2/3] btrfs: use normal workqueues for scrub Christoph Hellwig
2022-04-18  8:04   ` Qu Wenruo
2022-04-18  4:43 ` [PATCH 3/3] btrfs: use a normal workqueue for rmw_workers Christoph Hellwig
2022-04-18  8:05   ` Qu Wenruo
2022-04-22 21:22 ` btrfs_workqueue cleanups David Sterba

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=6bd7fdf2-62eb-d109-44bb-21a9eed09d3b@gmx.com \
    --to=quwenruo.btrfs@gmx.com \
    --cc=dsterba@suse.com \
    --cc=dsterba@suse.cz \
    --cc=hch@lst.de \
    --cc=josef@toxicpanda.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=wqu@suse.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