linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] design: fix computation of buffer log item bitmap size
@ 2021-11-10  1:58 Darrick J. Wong
  2021-12-22 22:08 ` Darrick J. Wong
  2021-12-23  6:06 ` Chandan Babu R
  0 siblings, 2 replies; 4+ messages in thread
From: Darrick J. Wong @ 2021-11-10  1:58 UTC (permalink / raw)
  To: xfs; +Cc: Wengang Wang

From: Darrick J. Wong <djwong@kernel.org>

Wengang Wang was trying to work through a buffer log item by consulting
the ondisk format documentation, and was confused by the formula given
in section 14.3.14 regarding the size of blf_data_map, aka the dirty
bitmap for buffer log items.  We noticed that the documentation doesn't
match what the kernel actually does, so let's fix this.

Reported-by: Wengang Wang <wen.gang.wang@oracle.com>
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
---
 .../journaling_log.asciidoc                        |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/design/XFS_Filesystem_Structure/journaling_log.asciidoc b/design/XFS_Filesystem_Structure/journaling_log.asciidoc
index 1dba56e..894d3e5 100644
--- a/design/XFS_Filesystem_Structure/journaling_log.asciidoc
+++ b/design/XFS_Filesystem_Structure/journaling_log.asciidoc
@@ -992,7 +992,7 @@ The size of +blf_data_map+, in 32-bit words.
 This variable-sized array acts as a dirty bitmap for the logged buffer.  Each
 1 bit represents a dirty region in the buffer, and each run of 1 bits
 corresponds to a subsequent log item containing the new contents of the buffer
-area.  Each bit represents +(blf_len * 512) / (blf_map_size * NBBY)+ bytes.
+area.  Each bit represents +(blf_len * 512) / (blf_map_size * sizeof(unsigned int) * NBBY)+ bytes.
 
 [[Buffer_Data_Log_Item]]
 === Buffer Data Log Item

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] design: fix computation of buffer log item bitmap size
  2021-11-10  1:58 [PATCH] design: fix computation of buffer log item bitmap size Darrick J. Wong
@ 2021-12-22 22:08 ` Darrick J. Wong
  2021-12-23  6:06 ` Chandan Babu R
  1 sibling, 0 replies; 4+ messages in thread
From: Darrick J. Wong @ 2021-12-22 22:08 UTC (permalink / raw)
  To: xfs; +Cc: Wengang Wang

On Tue, Nov 09, 2021 at 05:58:20PM -0800, Darrick J. Wong wrote:
> From: Darrick J. Wong <djwong@kernel.org>
> 
> Wengang Wang was trying to work through a buffer log item by consulting
> the ondisk format documentation, and was confused by the formula given
> in section 14.3.14 regarding the size of blf_data_map, aka the dirty
> bitmap for buffer log items.  We noticed that the documentation doesn't
> match what the kernel actually does, so let's fix this.
> 
> Reported-by: Wengang Wang <wen.gang.wang@oracle.com>
> Signed-off-by: Darrick J. Wong <djwong@kernel.org>

This is probably a bad time for this, but... ping?

--D

> ---
>  .../journaling_log.asciidoc                        |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/design/XFS_Filesystem_Structure/journaling_log.asciidoc b/design/XFS_Filesystem_Structure/journaling_log.asciidoc
> index 1dba56e..894d3e5 100644
> --- a/design/XFS_Filesystem_Structure/journaling_log.asciidoc
> +++ b/design/XFS_Filesystem_Structure/journaling_log.asciidoc
> @@ -992,7 +992,7 @@ The size of +blf_data_map+, in 32-bit words.
>  This variable-sized array acts as a dirty bitmap for the logged buffer.  Each
>  1 bit represents a dirty region in the buffer, and each run of 1 bits
>  corresponds to a subsequent log item containing the new contents of the buffer
> -area.  Each bit represents +(blf_len * 512) / (blf_map_size * NBBY)+ bytes.
> +area.  Each bit represents +(blf_len * 512) / (blf_map_size * sizeof(unsigned int) * NBBY)+ bytes.
>  
>  [[Buffer_Data_Log_Item]]
>  === Buffer Data Log Item

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] design: fix computation of buffer log item bitmap size
  2021-11-10  1:58 [PATCH] design: fix computation of buffer log item bitmap size Darrick J. Wong
  2021-12-22 22:08 ` Darrick J. Wong
@ 2021-12-23  6:06 ` Chandan Babu R
  2022-01-04  1:44   ` Darrick J. Wong
  1 sibling, 1 reply; 4+ messages in thread
From: Chandan Babu R @ 2021-12-23  6:06 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: xfs, Wengang Wang

On 10 Nov 2021 at 07:28, Darrick J. Wong wrote:
> From: Darrick J. Wong <djwong@kernel.org>
>
> Wengang Wang was trying to work through a buffer log item by consulting
> the ondisk format documentation, and was confused by the formula given
> in section 14.3.14 regarding the size of blf_data_map, aka the dirty
> bitmap for buffer log items.  We noticed that the documentation doesn't
> match what the kernel actually does, so let's fix this.
>
> Reported-by: Wengang Wang <wen.gang.wang@oracle.com>
> Signed-off-by: Darrick J. Wong <djwong@kernel.org>
> ---
>  .../journaling_log.asciidoc                        |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/design/XFS_Filesystem_Structure/journaling_log.asciidoc b/design/XFS_Filesystem_Structure/journaling_log.asciidoc
> index 1dba56e..894d3e5 100644
> --- a/design/XFS_Filesystem_Structure/journaling_log.asciidoc
> +++ b/design/XFS_Filesystem_Structure/journaling_log.asciidoc
> @@ -992,7 +992,7 @@ The size of +blf_data_map+, in 32-bit words.
>  This variable-sized array acts as a dirty bitmap for the logged buffer.  Each
>  1 bit represents a dirty region in the buffer, and each run of 1 bits
>  corresponds to a subsequent log item containing the new contents of the buffer
> -area.  Each bit represents +(blf_len * 512) / (blf_map_size * NBBY)+ bytes.
> +area.  Each bit represents +(blf_len * 512) / (blf_map_size * sizeof(unsigned int) * NBBY)+ bytes.
>  
>  [[Buffer_Data_Log_Item]]
>  === Buffer Data Log Item

The calculation looks correct. However, wouldn't it be better to mention,

"Each bit represents XFS_BLF_CHUNK (i.e. 128) bytes"

... or some such variant involving XFS_BLF_CHUNK.

-- 
chandan

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] design: fix computation of buffer log item bitmap size
  2021-12-23  6:06 ` Chandan Babu R
@ 2022-01-04  1:44   ` Darrick J. Wong
  0 siblings, 0 replies; 4+ messages in thread
From: Darrick J. Wong @ 2022-01-04  1:44 UTC (permalink / raw)
  To: Chandan Babu R; +Cc: xfs, Wengang Wang

On Thu, Dec 23, 2021 at 11:36:15AM +0530, Chandan Babu R wrote:
> On 10 Nov 2021 at 07:28, Darrick J. Wong wrote:
> > From: Darrick J. Wong <djwong@kernel.org>
> >
> > Wengang Wang was trying to work through a buffer log item by consulting
> > the ondisk format documentation, and was confused by the formula given
> > in section 14.3.14 regarding the size of blf_data_map, aka the dirty
> > bitmap for buffer log items.  We noticed that the documentation doesn't
> > match what the kernel actually does, so let's fix this.
> >
> > Reported-by: Wengang Wang <wen.gang.wang@oracle.com>
> > Signed-off-by: Darrick J. Wong <djwong@kernel.org>
> > ---
> >  .../journaling_log.asciidoc                        |    2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/design/XFS_Filesystem_Structure/journaling_log.asciidoc b/design/XFS_Filesystem_Structure/journaling_log.asciidoc
> > index 1dba56e..894d3e5 100644
> > --- a/design/XFS_Filesystem_Structure/journaling_log.asciidoc
> > +++ b/design/XFS_Filesystem_Structure/journaling_log.asciidoc
> > @@ -992,7 +992,7 @@ The size of +blf_data_map+, in 32-bit words.
> >  This variable-sized array acts as a dirty bitmap for the logged buffer.  Each
> >  1 bit represents a dirty region in the buffer, and each run of 1 bits
> >  corresponds to a subsequent log item containing the new contents of the buffer
> > -area.  Each bit represents +(blf_len * 512) / (blf_map_size * NBBY)+ bytes.
> > +area.  Each bit represents +(blf_len * 512) / (blf_map_size * sizeof(unsigned int) * NBBY)+ bytes.
> >  
> >  [[Buffer_Data_Log_Item]]
> >  === Buffer Data Log Item
> 
> The calculation looks correct. However, wouldn't it be better to mention,
> 
> "Each bit represents XFS_BLF_CHUNK (i.e. 128) bytes"
> 
> ... or some such variant involving XFS_BLF_CHUNK.

Ok.

--D

> 
> -- 
> chandan

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-01-04  1:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-10  1:58 [PATCH] design: fix computation of buffer log item bitmap size Darrick J. Wong
2021-12-22 22:08 ` Darrick J. Wong
2021-12-23  6:06 ` Chandan Babu R
2022-01-04  1:44   ` Darrick J. Wong

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).