xfs
[Top] [All Lists]

Re: [patch 10/12] xfs: shared code for grant head wakeups

To: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Subject: Re: [patch 10/12] xfs: shared code for grant head wakeups
From: Ben Myers <bpm@xxxxxxx>
Date: Thu, 16 Feb 2012 15:08:49 -0600
Cc: xfs@xxxxxxxxxxx
In-reply-to: <20111212141435.299712663@xxxxxxxxxxxxxxxxxxxxxx>
References: <20111212141346.986825692@xxxxxxxxxxxxxxxxxxxxxx> <20111212141435.299712663@xxxxxxxxxxxxxxxxxxxxxx>
User-agent: Mutt/1.5.18 (2008-05-17)
Replace xlog_reserveq_wake() and xlog_writeq_wake() with
xlog_grant_head_wake(), which takes a struct xlog_grant_head.

On Mon, Dec 12, 2011 at 09:13:57AM -0500, Christoph Hellwig wrote:
> Signed-off-by: Christoph Hellwig <hch@xxxxxx>
> 
> ---
>  fs/xfs/xfs_log.c   |   50 ++++++++++++++++++++------------------------------
>  fs/xfs/xfs_trace.h |    1 -
>  2 files changed, 20 insertions(+), 31 deletions(-)
> 
> Index: xfs/fs/xfs/xfs_log.c
> ===================================================================
> --- xfs.orig/fs/xfs/xfs_log.c 2011-12-11 21:31:10.580621915 +0100
> +++ xfs/fs/xfs/xfs_log.c      2011-12-11 21:32:08.763640044 +0100
> @@ -171,49 +171,39 @@ xlog_grant_head_wake_all(
>       spin_unlock(&head->lock);
>  }
>  
> -STATIC bool
> -xlog_reserveq_wake(
> +static inline int
> +xlog_ticket_reservation(
>       struct log              *log,
> -     int                     *free_bytes)
> +     struct xlog_grant_head  *head,
> +     struct xlog_ticket      *tic)
>  {
> -     struct xlog_ticket      *tic;
> -     int                     need_bytes;
> -
> -     list_for_each_entry(tic, &log->l_reserve_head.waiters, t_queue) {
> +     if (head == &log->l_write_head) {

Maybe it would be better to test a bit in the xlog_grant_head.  You
certainly have space since they are cacheline aligned... or take a bool
or flag to test.

Looks good.
Reviewed-by: Ben Myers <bpm@xxxxxxx>

<Prev in Thread] Current Thread [Next in Thread>
  • Re: [patch 10/12] xfs: shared code for grant head wakeups, Ben Myers <=