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: <x49k3o7sbsu.fsf@segfault.boston.devel.redhat.com>
Date:	Fri, 12 Apr 2013 17:01:53 -0400
From:	Jeff Moyer <jmoyer@...hat.com>
To:	Kent Overstreet <koverstreet@...gle.com>
Cc:	linux-kernel@...r.kernel.org, linux-aio@...ck.org,
	akpm@...ux-foundation.org, Zach Brown <zab@...hat.com>,
	Felipe Balbi <balbi@...com>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Mark Fasheh <mfasheh@...e.com>,
	Joel Becker <jlbec@...lplan.org>,
	Rusty Russell <rusty@...tcorp.com.au>,
	Jens Axboe <axboe@...nel.dk>,
	Asai Thambi S P <asamymuthupa@...ron.com>,
	Selvan Mani <smani@...ron.com>,
	Sam Bradshaw <sbradshaw@...ron.com>,
	Al Viro <viro@...iv.linux.org.uk>,
	Benjamin LaHaise <bcrl@...ck.org>,
	"Theodore Ts'o" <tytso@....edu>
Subject: Re: [PATCH 11/33] aio: make aio_put_req() lockless

Kent Overstreet <koverstreet@...gle.com> writes:

> Freeing a kiocb needed to touch the kioctx for three things:
>
>  * Pull it off the reqs_active list
>  * Decrementing reqs_active
>  * Issuing a wakeup, if the kioctx was in the process of being freed.
>
> This patch moves these to aio_complete(), for a couple reasons:
>
>  * aio_complete() already has to issue the wakeup, so if we drop the
>    kioctx refcount before aio_complete does its wakeup we don't have to
>    do it twice.
>  * aio_complete currently has to take the kioctx lock, so it makes sense
>    for it to pull the kiocb off the reqs_active list too.
>  * A later patch is going to change reqs_active to include unreaped
>    completions - this will mean allocating a kiocb doesn't have to look
>    at the ringbuffer. So taking the decrement of reqs_active out of
>    kiocb_free() is useful prep work for that patch.
>
> This doesn't really affect cancellation, since existing (usb) code that
> implements a cancel function still calls aio_complete() - we just have
> to make sure that aio_complete does the necessary teardown for cancelled
> kiocbs.
>
> It does affect code paths where we free kiocbs that were never
> submitted; they need to decrement reqs_active and pull the kiocb off the
> reqs_active list. This occurs in two places: kiocb_batch_free(), which
> is going away in a later patch, and the error path in io_submit_one.

After reading the patch description and the patch, I'm left wondering
whether you did this as a cleanup or a performance patch.

Anyway, I don't see any issue with it.

Acked-by: Jeff Moyer <jmoyer@...hat.com>
--
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