Re: [PATCH 1/6] Btrfs: fix deadlock in btrfs_commit_transaction

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Oct 26, 2010 at 09:36:26AM -0700, Sage Weil wrote:
> On Tue, 26 Oct 2010, liubo wrote:
> > 
> > Since wake_up() itself provides a implied wmb, and a wq active check, 
> > it is better to drop "if (wq)" in __btrfs_end_transaction().
> 
> I see.  It could also be
> 
>         smb_mb();
>         if (wq)
>                 wake_up();
> 
> but just calling wake_up() unconditionally is simpler, and fewer barriers 
> in the wake_up case.  I'm not attached to the if (wq); I just kept it 
> because it was there already.

wake_up() provides an implied barrier because it takes the lock.  I
usually do the smp_mb() + if (wq) dance when I'm working on a relatively
hot waitqueue.

-chris


--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux