lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20061031074645.GY14055@kernel.dk>
Date:	Tue, 31 Oct 2006 08:46:45 +0100
From:	Jens Axboe <jens.axboe@...cle.com>
To:	Eric Dumazet <dada1@...mosbay.com>
Cc:	Andrew Morton <akpm@...l.org>,
	linux-kernel <linux-kernel@...r.kernel.org>,
	Ingo Molnar <mingo@...e.hu>
Subject: Re: [PATCH] splice : two smp_mb() can be omitted

On Tue, Oct 31 2006, Eric Dumazet wrote:
> Jens Axboe a écrit :
> >On Tue, Oct 31 2006, Eric Dumazet wrote:
> >>This patch deletes two calls to smp_mb() that were done after 
> >>mutex_unlock() that contains an implicit memory barrier.
> >>
> >>The first one in splice_to_pipe(), where 'do_wakeup' is set to true only 
> >>if pipe->inode is set (and in this case the
> >>if (pipe->inode)
> >>   mutex_unlock(&pipe->inode->i_mutex);
> >>is done too)
> >>
> >>The second one in link_pipe(), following inode_double_unlock() that 
> >>contains calls to mutex_unlock() too.
> >
> >NAK on that patch, the smp_mb() follows the waitqueue_active(). If you
> >later change the code and move the locks or whatnot, you have lost that
> >connection.
> >
> >If you change the patch to insert a comment, then it may be more
> >applicable.
> >
> 
> Hum... I read fs/pipe.c and see no smp_mb() there, but I suspect same 
> semantics are/were used.
> 
> Should we add comments on fs/pipe.c too ?

fs/pipe.c looks different:

        if (do_wakeup) {
                wake_up_interruptible_sync(&pipe->wait);
                ...
        }

The smp_mb() is not needed if you call wake_up() directly, only if
checking via waitqueue_active().

-- 
Jens Axboe

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ