From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753933AbYERRma (ORCPT ); Sun, 18 May 2008 13:42:30 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751600AbYERRmU (ORCPT ); Sun, 18 May 2008 13:42:20 -0400 Received: from smtp1.linux-foundation.org ([140.211.169.13]:39572 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750831AbYERRmU (ORCPT ); Sun, 18 May 2008 13:42:20 -0400 Date: Sun, 18 May 2008 10:40:23 -0700 (PDT) From: Linus Torvalds To: Oleg Nesterov cc: Andrew Morton , Austin Clements , Ingo Molnar , john stultz , Michael Kerrisk , Roland McGrath , Thomas Gleixner , linux-kernel@vger.kernel.org Subject: Re: [PATCH 3/3] posix timers: use SIGQUEUE_CANCELLED when the timer is destroyed In-Reply-To: Message-ID: References: <20080517151422.GA9502@tv-sign.ru> <20080517153140.GA9534@tv-sign.ru> <20080518171543.GA25855@tv-sign.ru> User-Agent: Alpine 1.10 (LFD 962 2008-03-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 18 May 2008, Linus Torvalds wrote: > > So the rule is that if one bit of a word needs locking, then they *all* > do. Side note: the alternative, of course, is to just use the atomic bit operations. They aren't generally much (if at all) faster than locking + doing the operation + unlocking, but they can avoid lock contention, so if you do a lot of bit ops that need no other locking than the setting and clearing (possibly with testing), then they are the right choice. For signals, we obviously need other locking, so the atomic bit ops are a waste of time (doing *both* locking for other reasons *and* atomic bitops is obviously much slower than either). Linus