Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758835AbYC2CZn (ORCPT ); Fri, 28 Mar 2008 22:25:43 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1758189AbYC2CZT (ORCPT ); Fri, 28 Mar 2008 22:25:19 -0400 Received: from mx1.redhat.com ([66.187.233.31]:47743 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758082AbYC2CZQ (ORCPT ); Fri, 28 Mar 2008 22:25:16 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit From: Roland McGrath To: Linus Torvalds X-Fcc: ~/Mail/linus Cc: Andrew Morton , Martin Schwidefsky , linux-s390@vger.kernel.org, tony.luck@intel.com, linux-ia64@vger.kernel.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/4] set_restore_sigmask TIF_SIGPENDING In-Reply-To: Linus Torvalds's message of Friday, 28 March 2008 17:53:16 -0700 X-Fcc: ~/Mail/linus References: <20080329001230.D013726FA1D@magilla.localdomain> <20080329001341.7F93826FA1D@magilla.localdomain> X-Shopping-List: (1) Prosaic socks (2) Pious assumption turkeys (3) Dangerous fruit (4) Superstitious fads (5) Ambivalent sugar inflammations Message-Id: <20080329022408.0DD4726FA1D@magilla.localdomain> Date: Fri, 28 Mar 2008 19:24:08 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1906 Lines: 42 > Hmm. That probably means that TIF_RESTORE_SIGMASK shouldn't be a "TIF" > flag at all, but a "TS" ("thread status") flag. Yes. It only ever needs to be set or tested by the thread itself. It's used in an entirely synchronous fashion and never from interrupts or anything like that. I didn't tackle changing this at the same time because of the can of worms you cited (and because of doing one thing at a time). It could be a PF_* too, I suppose. There aren't too many of those bits free, but it would have the advantage of being a place for an arch that doesn't store any TS_* bits anywhere. Since acting on the flag is in arch signal code anyway, it makes some sense to let the arch define how it gets that to happen. I'll send some follow-on patches that change the conditionals to use #ifdef HAVE_SET_RESTORE_SIGMASK. Then an arch can define that to provide its own set_restore_sigmask() instead of TIF_RESTORE_SIGMASK, using a TS_* flag or whatever it likes. It will make for an easy slow transition by each arch whenever it decides it cares about the cycles. > I guess TIF_RESTORE_SIGMASK is never *so* performance-critical that we'd > care about the difference between a single cycle (approx) for a non-atomic > "or" into memory and an atomic bitop (~50 cycles or so). I doubt it is. There is always about to be a whole lot more overhead for taking siglock and all manner of synchronizing hooey, anyway. OTOH, my patch here just added a second set_thread_flag there purely for paranoia (it's probably never needed, but I'd have to be Oleg to be sure ;-). So even if 50 doesn't much matter, 51 sounds better than 100. Thanks, Roland -- 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/