From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751098AbbJBTZA (ORCPT ); Fri, 2 Oct 2015 15:25:00 -0400 Received: from mail-yk0-f172.google.com ([209.85.160.172]:36077 "EHLO mail-yk0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750844AbbJBTY6 (ORCPT ); Fri, 2 Oct 2015 15:24:58 -0400 Date: Fri, 2 Oct 2015 15:24:53 -0400 From: Tejun Heo To: Petr Mladek Cc: Andrew Morton , Oleg Nesterov , Ingo Molnar , Peter Zijlstra , Steven Rostedt , "Paul E. McKenney" , Josh Triplett , Thomas Gleixner , Linus Torvalds , Jiri Kosina , Borislav Petkov , Michal Hocko , linux-mm@kvack.org, Vlastimil Babka , live-patching@vger.kernel.org, linux-api@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC v2 07/18] kthread: Allow to cancel kthread work Message-ID: <20151002192453.GA7564@mtj.duckdns.org> References: <1442840639-6963-1-git-send-email-pmladek@suse.com> <1442840639-6963-8-git-send-email-pmladek@suse.com> <20150922193513.GE17659@mtj.duckdns.org> <20150925112617.GA3122@pathway.suse.cz> <20150928170314.GF2589@mtj.duckdns.org> <20151002154336.GC3122@pathway.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20151002154336.GC3122@pathway.suse.cz> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, On Fri, Oct 02, 2015 at 05:43:36PM +0200, Petr Mladek wrote: > IMHO, we need both locks. The worker manipulates more works and > need its own lock. We need work-specific lock because the work > might be assigned to different workers and we need to be sure > that the operations are really serialized, e.g. queuing. I don't think we need per-work lock. Do we have such usage in kernel at all? If you're worried, let the first queueing record the worker and trigger warning if someone tries to queue it anywhere else. This doesn't need to be full-on general like workqueue. Let's make reasonable trade-offs where possible. Thanks. -- tejun