From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758430Ab3HMQ33 (ORCPT ); Tue, 13 Aug 2013 12:29:29 -0400 Received: from merlin.infradead.org ([205.233.59.134]:59257 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758170Ab3HMQ3Z (ORCPT ); Tue, 13 Aug 2013 12:29:25 -0400 Date: Tue, 13 Aug 2013 18:29:16 +0200 From: Peter Zijlstra To: Linus Torvalds Cc: Ingo Molnar , Thomas Gleixner , Mike Galbraith , Peter Anvin , Andi Kleen , Linux Kernel Mailing List Subject: Re: [RFC] per-cpu preempt_count Message-ID: <20130813162916.GD24092@twins.programming.kicks-ass.net> References: <20130812115113.GE27162@twins.programming.kicks-ass.net> <20130812175830.GB18691@gmail.com> <20130813103056.GA2170@gmail.com> <20130813122652.GA24092@twins.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 13, 2013 at 08:39:46AM -0700, Linus Torvalds wrote: > Also, I think your patch is too big, and you should have aim to just > made the "preempt_count()" helper function mask off PREEMPT_MASK, so > that you don't change the semantics of that. I realize that there are > a couple of users that do things like "preempt_count() += x", and you > probably wanted to keep those working, but I think it is easier (and > cleaner) to fix those to "preempt_count_update(x)" instead of adding > all those explicitly PREEMPT_MASK masks. For sure.. but I didn't want to spend time cleaning things up until there was something half-way promising in it. The inverted need_resched that gives decl+jnz idea from Ingo should do it though. Not entirely sure I understand your MSB + jns suggestion: 0x80000002 - 1 = 0x80000001 Both are very much signed and neither wants to cause a reschedule.