[Top] [All Lists]

Re: [PATCH 06/10] xfs: struct xfs_buf_log_format isn't variable sized.

To: Dave Chinner <david@xxxxxxxxxxxxx>
Subject: Re: [PATCH 06/10] xfs: struct xfs_buf_log_format isn't variable sized.
From: Mark Tinguely <tinguely@xxxxxxx>
Date: Wed, 02 May 2012 08:39:02 -0500
Cc: xfs@xxxxxxxxxxx
In-reply-to: <1335249220-22274-7-git-send-email-david@xxxxxxxxxxxxx>
References: <1335249220-22274-1-git-send-email-david@xxxxxxxxxxxxx> <1335249220-22274-7-git-send-email-david@xxxxxxxxxxxxx>
User-agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:9.0) Gecko/20120122 Thunderbird/9.0
On 04/24/12 01:33, Dave Chinner wrote:
From: Dave Chinner<dchinner@xxxxxxxxxx>

The struct xfs_buf_log_format wants to think the dirty bitmap is
variable sized.  In fact, it is variable size on disk simply due to
the way we map it from the in-memory structure, but we still just
use a fixed size memory allocation for the in-memory structure.

Hence it makes no sense to set the function up as a variable sized
structure when we already know it's maximum size, and we always
allocate it as such. Simplify the structure by making the dirty
bitmap a fixed sized array and just using the size of the structure
for the allocation size.

This will make it much simpler to allocate and manipulate an array
of format structures for discontiguous buffer support.

The previous struct xfs_buf_log_item size according to
/proc/slabinfo was 224 bytes. pahole doesn't give the same size
because of the variable size definition. With this modification,
pahole reports the same as /proc/slabinfo:

        /* size: 224, cachelines: 4, members: 6 */

Signed-off-by: Dave Chinner<dchinner@xxxxxxxxxx>

Looks good.

Reviewed-by: Mark Tinguely <tinguely@xxxxxxx>

<Prev in Thread] Current Thread [Next in Thread>
  • Re: [PATCH 06/10] xfs: struct xfs_buf_log_format isn't variable sized., Mark Tinguely <=