Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751539Ab3I0GCU (ORCPT ); Fri, 27 Sep 2013 02:02:20 -0400 Received: from mail-ee0-f51.google.com ([74.125.83.51]:48664 "EHLO mail-ee0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750934Ab3I0GCS (ORCPT ); Fri, 27 Sep 2013 02:02:18 -0400 Date: Fri, 27 Sep 2013 08:02:13 +0200 From: Ingo Molnar To: Tim Chen Cc: Jason Low , Davidlohr Bueso , Ingo Molnar , Andrew Morton , Andrea Arcangeli , Alex Shi , Andi Kleen , Michel Lespinasse , Davidlohr Bueso , Matthew R Wilcox , Dave Hansen , Peter Zijlstra , Rik van Riel , Peter Hurley , linux-kernel@vger.kernel.org, linux-mm Subject: Re: [PATCH v6 5/6] MCS Lock: Restructure the MCS lock defines and locking code into its own file Message-ID: <20130927060213.GA6673@gmail.com> References: <1380147049.3467.67.camel@schen9-DESK> <1380226007.2170.2.camel@buesod1.americas.hpqcorp.net> <1380226997.2602.11.camel@j-VirtualBox> <1380228059.2170.10.camel@buesod1.americas.hpqcorp.net> <1380229794.2602.36.camel@j-VirtualBox> <1380231702.3467.85.camel@schen9-DESK> <1380235333.3229.39.camel@j-VirtualBox> <1380236265.3467.103.camel@schen9-DESK> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1380236265.3467.103.camel@schen9-DESK> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 927 Lines: 25 * Tim Chen wrote: > > If we prefer to optimize this a bit though, perhaps we can first move > > the node->lock = 0 so that it gets executed after the "if (likely(prev > > == NULL)) {}" code block and then delete "node->lock = 1" inside the > > code block. > > I suppose we can save one single assignment. The gain is probably not > noticeable as once we set node->next to NULL, node->locked is likely in > local cache line and the assignment operation is cheap. Would be nice to have this as a separate, add-on patch. Every single instruction removal that has no downside is an upside! You can add a comment that explains it. Thanks, Ingo -- 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/