From patchwork Mon Sep 21 16:28:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "gregkh@linuxfoundation.org" X-Patchwork-Id: 263671 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 226AAC43465 for ; Mon, 21 Sep 2020 16:47:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D879E238A1 for ; Mon, 21 Sep 2020 16:47:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600706863; bh=P/PxZeQPMHOTOkoljOroiNVXDF38g1kOW4nfT5aRXik=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=wmQAyC2CFnk+3DpYl6Z13V7YJ9Q2hz13PCuo6SCE0puFjnOwG/V5YC7vE9qlvG40u oS1uo/gzlJ1omqCupflW67i48RcJWlcDU570JXjjEMnFtKea3hPmswFH14kSHiEF+I hv2Eu5epE1JGTNNE3YrTZlNMND0GbbBMiM64mNzQ= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728029AbgIUQrn (ORCPT ); Mon, 21 Sep 2020 12:47:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:54708 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729401AbgIUQrm (ORCPT ); Mon, 21 Sep 2020 12:47:42 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 56782238A1; Mon, 21 Sep 2020 16:47:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600706861; bh=P/PxZeQPMHOTOkoljOroiNVXDF38g1kOW4nfT5aRXik=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YdZYQSTMJjtBZ3HMVFEX7Jun08ROCU723fd8m2rE9/sdTi0EdMxXKzvD5ZSApMkTt EnfCj+YW/09rsRzv6SOUeTfOhrwyVuARLn+vm69mc1LX29VV8G2sDoTPYVxRiUtUMQ jRIMq0UW7CUyARQPwCKcFBNsYkBpiRPK73WOfvWo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sunghyun Jin , Dennis Zhou Subject: [PATCH 5.8 095/118] percpu: fix first chunk size calculation for populated bitmap Date: Mon, 21 Sep 2020 18:28:27 +0200 Message-Id: <20200921162040.773527953@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200921162036.324813383@linuxfoundation.org> References: <20200921162036.324813383@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Sunghyun Jin commit b3b33d3c43bbe0177d70653f4e889c78cc37f097 upstream. Variable populated, which is a member of struct pcpu_chunk, is used as a unit of size of unsigned long. However, size of populated is miscounted. So, I fix this minor part. Fixes: 8ab16c43ea79 ("percpu: change the number of pages marked in the first_chunk pop bitmap") Cc: # 4.14+ Signed-off-by: Sunghyun Jin Signed-off-by: Dennis Zhou Signed-off-by: Greg Kroah-Hartman --- mm/percpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/mm/percpu.c +++ b/mm/percpu.c @@ -1300,7 +1300,7 @@ static struct pcpu_chunk * __init pcpu_a /* allocate chunk */ alloc_size = sizeof(struct pcpu_chunk) + - BITS_TO_LONGS(region_size >> PAGE_SHIFT); + BITS_TO_LONGS(region_size >> PAGE_SHIFT) * sizeof(unsigned long); chunk = memblock_alloc(alloc_size, SMP_CACHE_BYTES); if (!chunk) panic("%s: Failed to allocate %zu bytes\n", __func__,