Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752093AbdI0VfQ (ORCPT ); Wed, 27 Sep 2017 17:35:16 -0400 Received: from mail-it0-f68.google.com ([209.85.214.68]:50006 "EHLO mail-it0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751801AbdI0VfN (ORCPT ); Wed, 27 Sep 2017 17:35:13 -0400 X-Google-Smtp-Source: AOwi7QBVxC6VFugsX1VoQaeQN2UVbfgKeG1QR62uGhke5sE3HUi8SG4ZsGwrJaeKVK+xmxuolALxQw== From: Dennis Zhou To: Tejun Heo , Christoph Lameter , Luis Henriques Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Dennis Zhou Subject: [PATCH 1/2] percpu: fix starting offset for chunk statistics traversal Date: Wed, 27 Sep 2017 16:34:59 -0500 Message-Id: <1506548100-31247-2-git-send-email-dennisszhou@gmail.com> X-Mailer: git-send-email 1.8.5.2 (Apple Git-48) In-Reply-To: <1506548100-31247-1-git-send-email-dennisszhou@gmail.com> References: <1506548100-31247-1-git-send-email-dennisszhou@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 857 Lines: 26 This patch fixes the starting offset used when scanning chunks to compute the chunk statistics. The value start_offset (and end_offset) are managed in bytes while the traversal occurs over bits. Thus for the reserved and dynamic chunk, it may incorrectly skip over the initial allocations. Signed-off-by: Dennis Zhou --- mm/percpu-stats.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/percpu-stats.c b/mm/percpu-stats.c index 6142484..7a58460 100644 --- a/mm/percpu-stats.c +++ b/mm/percpu-stats.c @@ -73,7 +73,7 @@ static void chunk_map_stats(struct seq_file *m, struct pcpu_chunk *chunk, last_alloc + 1 : 0; as_len = 0; - start = chunk->start_offset; + start = chunk->start_offset / PCPU_MIN_ALLOC_SIZE; /* * If a bit is set in the allocation map, the bound_map identifies -- 1.8.3.1