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]
Date:	Wed, 6 Feb 2013 19:35:24 +0800
From:	Lai Jiangshan <eag0628@...il.com>
To:	Tejun Heo <tj@...nel.org>
Cc:	Lai Jiangshan <laijs@...fujitsu.com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 03/13] workqueue: don't set work cwq until we queued it on pool

On Wed, Feb 6, 2013 at 12:45 AM, Tejun Heo <tj@...nel.org> wrote:
> Hey, Lai.
>
> On Tue, Feb 05, 2013 at 11:00:42PM +0800, Lai Jiangshan wrote:
>> The @cpu can be WORK_CPU_UNBOUND, and the current code will delay
>> to determine on which cpu should this work be queued until timeout,
>> I didn't want to change this behavior when I wrote the patch.
>
> Hmmm?  The current code determines the CPU on queue_delayed_work().
>
>         /*
>          * If we cannot get the last pool from @work directly,
>          * select the last CPU such that it avoids unnecessarily
>          * triggering non-reentrancy check in __queue_work().
>          */
>         lcpu = cpu;
>         if (pool)
>                 lcpu = pool->cpu;
>         if (lcpu == WORK_CPU_UNBOUND)
>                 lcpu = raw_smp_processor_id();
>
> @lcpu is never WORK_CPU_UNBOUND for bound workqueues and for unbound
> workqueues we of course have cwq for WORK_CPU_UNBOUND.


Are you sure?
@lcpu is only used when it tries to set cwq to work data without
breaking nrt logic.

void delayed_work_timer_fn(unsigned long __data)
{
	struct delayed_work *dwork = (struct delayed_work *)__data;
	struct cpu_workqueue_struct *cwq = get_work_cwq(&dwork->work);

	/* should have been called from irqsafe timer with irq already off */
	__queue_work(dwork->cpu, cwq->wq, &dwork->work);
}

>
>> PS, again, @cpu and @wq can be saved/encoded in dwork.work.entry if needed.
>
> If possible, I'd much prefer to keep it inside delayed_work() proper.
>
> Thanks.
>
> --
> tejun
--
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