Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932880AbbGUP2q (ORCPT ); Tue, 21 Jul 2015 11:28:46 -0400 Received: from mail-yk0-f174.google.com ([209.85.160.174]:36802 "EHLO mail-yk0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932618AbbGUP2o (ORCPT ); Tue, 21 Jul 2015 11:28:44 -0400 Date: Tue, 21 Jul 2015 11:28:40 -0400 From: Tejun Heo To: Baoquan He Cc: cl@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/3] perpuc: check pcpu_first_chunk and pcpu_reserved_chunk to avoid handling them twice Message-ID: <20150721152840.GG15934@mtj.duckdns.org> 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.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1080 Lines: 26 On Mon, Jul 20, 2015 at 10:55:29PM +0800, Baoquan He wrote: > 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; > > Then it could point to static chunk too if dynamic chunk doesn't exist. So > in this patch adding a check in percpu_init_late() to see if pcpu_first_chunk > is equal to pcpu_reserved_chunk. Only if they are not equal we add > pcpu_reserved_chunk to the target array. So, I don't think this is actually possible. dyn_size can't be zero so if reserved chunk is created, dyn chunk is also always created and thus first chunk can't equal reserved chunk. It might be useful to add some comments explaining this or maybe WARN_ON() but I don't think this path is necessary. Thanks. -- tejun -- 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/