Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755453AbbHYMrG (ORCPT ); Tue, 25 Aug 2015 08:47:06 -0400 Received: from casper.infradead.org ([85.118.1.10]:34016 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752387AbbHYMrE (ORCPT ); Tue, 25 Aug 2015 08:47:04 -0400 Date: Tue, 25 Aug 2015 14:46:55 +0200 From: Peter Zijlstra To: Ingo Molnar Cc: George Spelvin , dave@sr71.net, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux@rasmusvillemoes.dk, riel@redhat.com, rientjes@google.com, torvalds@linux-foundation.org Subject: Re: [PATCH 3/3 v3] mm/vmalloc: Cache the vmalloc memory info Message-ID: <20150825124655.GQ16853@twins.programming.kicks-ass.net> References: <20150823060443.GA9882@gmail.com> <20150823064603.14050.qmail@ns.horizon.com> <20150823081750.GA28349@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150823081750.GA28349@gmail.com> 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 Content-Length: 765 Lines: 22 On Sun, Aug 23, 2015 at 10:17:51AM +0200, Ingo Molnar wrote: > +static u64 vmap_info_gen; > +static u64 vmap_info_cache_gen; > +void get_vmalloc_info(struct vmalloc_info *vmi) > +{ > + u64 gen = READ_ONCE(vmap_info_gen); > + > + /* > + * If the generation counter of the cache matches that of > + * the vmalloc generation counter then return the cache: > + */ > + if (READ_ONCE(vmap_info_cache_gen) == gen) { Why are those things u64? It has the obvious down-side that you still get split loads on 32bit machines. -- 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/