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: <CABE8wwvLysxv=dGxsP2zKAvWFaZwHdZDf9PwXpdYHZQNDTvJpg@mail.gmail.com>
Date:	Fri, 2 Dec 2011 17:53:40 -0800
From:	"Williams, Dan J" <dan.j.williams@...el.com>
To:	tj@...nel.org, JBottomley@...allels.com
Cc:	linux-kernel@...r.kernel.org, linux-scsi@...r.kernel.org
Subject: Re: [PATCH 2/3] workqueue: defer work to a draining queue

On Fri, Dec 2, 2011 at 3:56 PM, Dan Williams <dan.j.williams@...el.com> wrote:
[..]
> @@ -2405,7 +2434,7 @@ void drain_workqueue(struct workqueue_struct *wq)
>         */
>        spin_lock_irq(&workqueue_lock);
>        if (!wq->nr_drainers++)
> -               wq->flags |= WQ_DRAINING;
> +               wq->flags |= WQ_DRAINING | flags;
>        spin_unlock_irq(&workqueue_lock);
>  reflush:
>        flush_workqueue(wq);
> @@ -2429,9 +2458,25 @@ reflush:
>        }
>
>        spin_lock_irq(&workqueue_lock);
> -       if (!--wq->nr_drainers)
> -               wq->flags &= ~WQ_DRAINING;
> +       if (!--wq->nr_drainers) {
> +               wq->flags &= ~(WQ_DRAINING | WQ_NO_DEFER);
> +               list_splice_init(&wq->drain_defer, &drain_defer);
> +               ret = !list_empty(&drain_defer);
> +       }
>        spin_unlock_irq(&workqueue_lock);
> +
> +       /* requeue work on this queue provided it was not being destroyed */
> +       list_for_each_entry_safe(work, w, &drain_defer, entry) {
> +               list_del_init(&work->entry);
> +               queue_work(wq, work);
> +       }

Actually, this won't work.  The queuing of deferred work would need to
be under the lock and then flushed again to guarantee workqueue
semantics which just devolves into a "wait until all work stops being
submitted to the queue for one drain_workqueue() duration".  Which is
more than what we need for libsas.
--
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