Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753610AbbGWByB (ORCPT ); Wed, 22 Jul 2015 21:54:01 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54014 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750779AbbGWByA (ORCPT ); Wed, 22 Jul 2015 21:54:00 -0400 Date: Thu, 23 Jul 2015 09:53:54 +0800 From: Baoquan He To: tj@kernel.org, cl@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 2/3] percpu: Add WARN_ON into percpu_init_late Message-ID: <20150723015354.GB1844@dhcp-17-102.nay.redhat.com> References: <1437404130-5188-1-git-send-email-bhe@redhat.com> <1437404130-5188-2-git-send-email-bhe@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1437404130-5188-2-git-send-email-bhe@redhat.com> 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: 1350 Lines: 39 In pcpu_setup_first_chunk() pcpu_reserved_chunk is assigned to point to static chunk. While pcpu_first_chunk is got from below code: pcpu_first_chunk = dchunk ?: schunk; pcpu_first_chunk might point to static chunk too with possibility. Add a WARN_ON here to yell out if that happened.*/ Signed-off-by: Baoquan He --- mm/percpu.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/mm/percpu.c b/mm/percpu.c index 8cf18dc..974600b 100644 --- a/mm/percpu.c +++ b/mm/percpu.c @@ -2275,6 +2275,13 @@ void __init percpu_init_late(void) unsigned long flags; int i; + /* In pcpu_setup_first_chunk() pcpu_reserved_chunk is assigned to point to + * static chunk. While pcpu_first_chunk is got from below code: + * pcpu_first_chunk = dchunk ?: schunk; + * pcpu_first_chunk might point to static chunk too with possibility. Add a + * WARN_ON here to yell out if that happened.*/ + WARN_ON(pcpu_first_chunk == pcpu_reserved_chunk); + for (i = 0; (chunk = target_chunks[i]); i++) { int *map; const size_t size = PERCPU_DYNAMIC_EARLY_SLOTS * sizeof(map[0]); -- 2.4.3 -- 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/