Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932084AbbKXU3B (ORCPT ); Tue, 24 Nov 2015 15:29:01 -0500 Received: from mail-yk0-f176.google.com ([209.85.160.176]:33146 "EHLO mail-yk0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753726AbbKXU27 (ORCPT ); Tue, 24 Nov 2015 15:28:59 -0500 Date: Tue, 24 Nov 2015 15:28:55 -0500 From: Tejun Heo To: Linus Torvalds Cc: Petr Mladek , Andrew Morton , Oleg Nesterov , Ingo Molnar , Peter Zijlstra , Steven Rostedt , "Paul E. McKenney" , Josh Triplett , Thomas Gleixner , Jiri Kosina , Borislav Petkov , Michal Hocko , linux-mm , Vlastimil Babka , Linux API , Linux Kernel Mailing List Subject: Re: [PATCH v3 09/22] kthread: Allow to cancel kthread work Message-ID: <20151124202855.GV17033@mtj.duckdns.org> References: <1447853127-3461-1-git-send-email-pmladek@suse.com> <1447853127-3461-10-git-send-email-pmladek@suse.com> <20151123225823.GI19072@mtj.duckdns.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 846 Lines: 26 Hello, On Tue, Nov 24, 2015 at 12:23:53PM -0800, Linus Torvalds wrote: > instead (possibly just "spin_unlock_wait()" - but the explicit loop I see. Wasn't thinking about cache traffic. Yeah, spin_unlock_wait() seems a lot better. > might be worth it if you then want to check the "canceling" flag > independently of the lock state too). > > In general, it's very dangerous to try to cook up your own locking > rules. People *always* get it wrong. It's either trylock on timer side or timer active spinning trick on canceling side, so this seems the lesser of the two evils. Thanks. -- tejun -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/