Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754577AbbHXNpk (ORCPT ); Mon, 24 Aug 2015 09:45:40 -0400 Received: from mailrelay.lanline.com ([216.187.10.16]:33391 "EHLO mailrelay.lanline.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754540AbbHXNpi (ORCPT ); Mon, 24 Aug 2015 09:45:38 -0400 X-Greylist: delayed 2032 seconds by postgrey-1.27 at vger.kernel.org; Mon, 24 Aug 2015 09:45:38 EDT MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <21979.6150.929309.800457@quad.stoffel.home> Date: Mon, 24 Aug 2015 09:11:34 -0400 From: "John Stoffel" To: Ingo Molnar Cc: George Spelvin , dave@sr71.net, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux@rasmusvillemoes.dk, peterz@infradead.org, riel@redhat.com, rientjes@google.com, torvalds@linux-foundation.org Subject: Re: [PATCH 3/3 v4] mm/vmalloc: Cache the vmalloc memory info In-Reply-To: <20150824073422.GC13082@gmail.com> References: <20150823081750.GA28349@gmail.com> <20150824010403.27903.qmail@ns.horizon.com> <20150824073422.GC13082@gmail.com> X-Mailer: VM 8.2.0b under 23.4.1 (x86_64-pc-linux-gnu) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1039 Lines: 33 >>>>> "Ingo" == Ingo Molnar writes: Ingo> * George Spelvin wrote: >> First, an actual, albeit minor, bug: initializing both vmap_info_gen >> and vmap_info_cache_gen to 0 marks the cache as valid, which it's not. Ingo> Ha! :-) Fixed. >> vmap_info_gen should be initialized to 1 to force an initial >> cache update. Blech, it should be initialized with a proper #define VMAP_CACHE_NEEDS_UPDATE 1, instead of more magic numbers. Ingo> + */ Ingo> +static DEFINE_SPINLOCK(vmap_info_lock); Ingo> +static int vmap_info_gen = 1; static int vmap_info_gen = VMAP_CACHE_NEEDS_UPDATE; Ingo> +static int vmap_info_cache_gen; Ingo> +static struct vmalloc_info vmap_info_cache; Ingo> +#endif This will help keep bugs like this out in the future... I hope! -- 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/