Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752033AbdI0VfJ (ORCPT ); Wed, 27 Sep 2017 17:35:09 -0400 Received: from mail-io0-f195.google.com ([209.85.223.195]:34221 "EHLO mail-io0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751801AbdI0VfI (ORCPT ); Wed, 27 Sep 2017 17:35:08 -0400 X-Google-Smtp-Source: AOwi7QDhp3r4eJyfiMHv/dW8sYKF2RWcEuz1JckNuPgTZehYJkYItvWuqeDfk4l2eBUUwM9tjoqi6A== From: Dennis Zhou To: Tejun Heo , Christoph Lameter , Luis Henriques Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Dennis Zhou Subject: [PATCH 0/2] percpu: fix block iterators and reserved chunk stats Date: Wed, 27 Sep 2017 16:34:58 -0500 Message-Id: <1506548100-31247-1-git-send-email-dennisszhou@gmail.com> X-Mailer: git-send-email 1.8.5.2 (Apple Git-48) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1557 Lines: 41 Hi everyone, This patchset includes two bug fixes related to bitmap percpu memory allocator. The first is a problem with how the start offset is managed in bytes, but the bitmaps are traversed in bits. The start offset is maintained to keep alignment true within the actual allocation area in the chunk. With the reserved and dynamic chunk, this may unintentionally skip over a portion proportional to the start offset and PCPU_MIN_ALLOC_SIZE. The second is an issue reported by Luis in [1]. The allocator was unable to allocate from the reserved chunk due to the block offset not being reset within the iterator. This caused subsequently checked blocks to check against a potentially higher block offset. This may lead the iterator to believe it had checked this area in the prior iteration. The fix is to simply reset the block offset to 0 after it is used allowing the predicate to always evaluate to true for subsequent blocks. [1] https://lkml.org/lkml/2017/9/26/506 This patchset contains the following 2 patches: 0001-percpu-fix-starting-offset-for-chunk-statistics-trav.patch 0002-percpu-fix-iteration-to-prevent-skipping-over-block.patch 0001 fixes the chunk start offset issue. 0002 fixes the iteration bug. This patchset is on top of linus#v4.14-rc2 e19b205be4. diffstats below: Dennis Zhou (2): percpu: fix starting offset for chunk statistics traversal percpu: fix iteration to prevent skipping over block mm/percpu-stats.c | 2 +- mm/percpu.c | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) Thanks, Dennis