xfs
[Top] [All Lists]

Re: [PATCH] Give logbufs a better default

To: Andi Kleen <ak@xxxxxxx>
Subject: Re: [PATCH] Give logbufs a better default
From: Steve Lord <lord@xxxxxxx>
Date: 11 Jun 2003 15:33:14 -0500
Cc: linux-xfs@xxxxxxxxxxx
In-reply-to: <20030611093525.GA2329@xxxxxxxxxxxxx>
Organization:
References: <20030611093525.GA2329@xxxxxxxxxxxxx>
Sender: linux-xfs-bounce@xxxxxxxxxxx
On Wed, 2003-06-11 at 04:35, Andi Kleen wrote:
> A long standing problem in XFS is that in the default configuration
> metadata performance is not that great because it uses not enough
> log buffers. There are FAQs around to fix this, but it would be better
> if the kernel did the right thing by default.
> 
> The main problem is probably that XFS still uses the default from the
> early 90ies, which are probably not that good anymore for today's machines.
> 
> This patch changes the logbufs= default based on the available memory.
> If you have 128MB or less it uses 3 logbufs (normally 96K per file system) 
> For 400MB or less it uses 5 (160K) 
> For anything bigger 8 (256K) 

Hi Andi,

Just wondering why you picked odd numbers? 

> 
> It is still a kind of bandaid. I think the better solution would be to 
> dynamically allocate new log buffers as needed until some limit
> (and block if the memory cannot be allocated). This should not be that
> bad because vmalloc/vfree are not that expensive anymore and with some
> luck you can even get a physically continuous buffer (e.g. on a 16byte page 
> size
> ia64 system) 

Interesting idea, one issue is that during recovery, the maximum amount
of outstanding I/O there might of been (i.e. number of iclog buffers)
is a factor in how much work there is to do. Adding new ones dynamically
might be possible, but there is this 'interesting' state machine on the
log buffers to deal with there.

Thanks

 Steve

> 
> Patch for XFS 1.3pre1.
> 
> -Andi
> 
> 
> --- linux/fs/xfs/xfs_log.c-o  2003-06-10 14:27:57.000000000 +0200
> +++ linux/fs/xfs/xfs_log.c    2003-06-11 11:29:55.000000000 +0200
> @@ -1072,9 +1072,15 @@
>                * This is the normal path.  If m_logbufs == -1, then the
>                * admin has chosen to use the system defaults for logbuffers.
>                */
> -             if (mp->m_logbufs == -1)
> -                     log->l_iclog_bufs = XLOG_NUM_ICLOGS;
> -             else
> +             if (mp->m_logbufs == -1) { 
> +                     if (xfs_physmem <= btoc(128*1024*1024)) { 
> +                             log->l_iclog_bufs = 3; 
> +                     } else if (xfs_physmem <= btoc(400*1024*1024)) { 
> +                             log->l_iclog_bufs = 5; 
> +                     } else {
> +                             log->l_iclog_bufs = 8; /* 256K with 32K bufs */
> +                     }
> +             } else
>                       log->l_iclog_bufs = mp->m_logbufs;
>  
>  #if defined(DEBUG) || defined(XLOG_NOLOG)
-- 

Steve Lord                                      voice: +1-651-683-3511
Principal Engineer, Filesystem Software         email: lord@xxxxxxx


<Prev in Thread] Current Thread [Next in Thread>