From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pd0-f182.google.com (mail-pd0-f182.google.com [209.85.192.182]) by kanga.kvack.org (Postfix) with ESMTP id BFE566B0032 for ; Fri, 27 Sep 2013 02:02:20 -0400 (EDT) Received: by mail-pd0-f182.google.com with SMTP id r10so2168756pdi.27 for ; Thu, 26 Sep 2013 23:02:20 -0700 (PDT) Received: by mail-ee0-f54.google.com with SMTP id e53so994417eek.27 for ; Thu, 26 Sep 2013 23:02:16 -0700 (PDT) Date: Fri, 27 Sep 2013 08:02:13 +0200 From: Ingo Molnar 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> Sender: owner-linux-mm@kvack.org List-ID: 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 * 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, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org