From patchwork Sun Oct 7 08:31:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Rapoport X-Patchwork-Id: 10629411 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D000B16B1 for ; Sun, 7 Oct 2018 08:32:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A8CBD2914F for ; Sun, 7 Oct 2018 08:32:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8573C29199; Sun, 7 Oct 2018 08:32:11 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E16A52914F for ; Sun, 7 Oct 2018 08:32:10 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 32CB46B000A; Sun, 7 Oct 2018 04:32:08 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 2DC3F6B000C; Sun, 7 Oct 2018 04:32:08 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1A4F36B000D; Sun, 7 Oct 2018 04:32:08 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-ot1-f70.google.com (mail-ot1-f70.google.com [209.85.210.70]) by kanga.kvack.org (Postfix) with ESMTP id E0DAB6B000A for ; Sun, 7 Oct 2018 04:32:07 -0400 (EDT) Received: by mail-ot1-f70.google.com with SMTP id c21-v6so13076989otf.9 for ; Sun, 07 Oct 2018 01:32:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:from:to:cc :subject:date:message-id; bh=b6Zx/KHHrb/5RuRJso9gBtq0Yt/ZZJb1qviE9X8VJk4=; b=ZrSp4LhUxeNm0U5y+vm06fvYqB2m8h5ONBCL3RaFm6iuNpafuWGI1wMlrPPWpYG1f+ DJvb5LH6Sr+J+zU7OfDf7yeVGHA+MTj5QGvpQOd7ZgKS9YIfwq/Z6khRpXfGKMCRRx8P SVan11ME3nxGnbdmcTv+VV8Tb8rlgsG5gxfWwmXBMca/gFgvgwPfB33nDEHS4U/GyEOK K8MQs8mkTNm8CX3sokph2dBwCsgMUhHHoIbb9TOpMtzCiEvLayfkwO37pButpXlI2PMQ C5sc1xP9ps03HpNNBTzfHDQ962PKbDskQ7Yd6L3ZK2pivtRN6t/xCHtdaG/9RRKx/7pm Istw== X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 148.163.156.1 is neither permitted nor denied by best guess record for domain of rppt@linux.vnet.ibm.com) smtp.mailfrom=rppt@linux.vnet.ibm.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com X-Gm-Message-State: ABuFfoh+gc6VqgTRxcNr9Jo+waGoqN8ICiAATCh+XIYg5TA007Ug7Ge/ gOeFA4i3WBT8NUb37du4J6m748QeppLHsmQeQmi05BV/EYSovEIw7g0PGqgvuLTKKps8lqgktn+ PyGpH6kaH3Ppi4JihpaA62DIhV1df2HnzNpxYf4yqlhkEmRQLei32YB/5+KWFXW0= X-Received: by 2002:aca:b40a:: with SMTP id d10-v6mr2584159oif.190.1538901127556; Sun, 07 Oct 2018 01:32:07 -0700 (PDT) X-Google-Smtp-Source: ACcGV62p+OgyIvYx9/WCm4rDXhkZ321LRsdbVOSNr49fJXd3fm05NBz3Z2siIJc9HsBbatlP+v9v X-Received: by 2002:aca:b40a:: with SMTP id d10-v6mr2584149oif.190.1538901126895; Sun, 07 Oct 2018 01:32:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538901126; cv=none; d=google.com; s=arc-20160816; b=JgpbASetocdgrDOi6OMN05U/qvCaYzF2UZsjHpuxIwqnmIB3dwiPTV0ChiSo4mwZ3K Fo4frOYxt/9bn7nHB6BM1Dk5wEqBWjEAGxik5jogJLIrIrPc15QgR0iuklI86h6tqrBE r0DLqknj1HuI6cB8bdfiHLbwhMHW4qFx5O6SYrdASd3376dKL3LpkhpKGi2dECzccgfU XVm8VhBlQiyg4v30lrF/BmDZbEGWzY/uGREFpSGTfVTaq+DmUp0AdQFtthb56s39hNAe 2B3wCsTq8+6LitKoGMCKMAMLbz/nKoQq0XpC2fOSle0yiwf+WueTPGTxWpfKmpFVTX6J sVSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:cc:to:from; bh=b6Zx/KHHrb/5RuRJso9gBtq0Yt/ZZJb1qviE9X8VJk4=; b=VBH5QcZnxceaqB9H6trpWqTLHWUV6l7iv2O/qWnVLuTDzs5tklNqmO1K2oiNpswzLb MbJhUks9lFVVNb8ElWnsSa0YIf4ChKNia1ynTQPEv2YAz63n8VWFoQ77G4UBA7pwNVrH lZjo2QK6R43vRRCea7y9G02XpmabLHUsnMCuOYXXbtjy7iwZmtadT4o4wYOn7GXfNUFR b5iYycYIdnk8NuU2ClxD5sr0X5epmb78X+G1vYLKZhFTmunCsdqcurDuKoLLkzOlhZeO uIapEZ6/zyxzaUyGTH6xSC3lYP5CozU1nl3kkHnJ/sArqSGhXBpoBSTNC47lYeZlBy1I Dd3w== ARC-Authentication-Results: i=1; mx.google.com; spf=neutral (google.com: 148.163.156.1 is neither permitted nor denied by best guess record for domain of rppt@linux.vnet.ibm.com) smtp.mailfrom=rppt@linux.vnet.ibm.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com. [148.163.156.1]) by mx.google.com with ESMTPS id o8-v6si6369027oia.264.2018.10.07.01.32.06 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 07 Oct 2018 01:32:06 -0700 (PDT) Received-SPF: neutral (google.com: 148.163.156.1 is neither permitted nor denied by best guess record for domain of rppt@linux.vnet.ibm.com) client-ip=148.163.156.1; Authentication-Results: mx.google.com; spf=neutral (google.com: 148.163.156.1 is neither permitted nor denied by best guess record for domain of rppt@linux.vnet.ibm.com) smtp.mailfrom=rppt@linux.vnet.ibm.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w978Uvjb139537 for ; Sun, 7 Oct 2018 04:32:06 -0400 Received: from e06smtp02.uk.ibm.com (e06smtp02.uk.ibm.com [195.75.94.98]) by mx0a-001b2d01.pphosted.com with ESMTP id 2myepvg0xf-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Sun, 07 Oct 2018 04:32:05 -0400 Received: from localhost by e06smtp02.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sun, 7 Oct 2018 09:32:03 +0100 Received: from b06cxnps3075.portsmouth.uk.ibm.com (9.149.109.195) by e06smtp02.uk.ibm.com (192.168.101.132) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Sun, 7 Oct 2018 09:32:00 +0100 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w978VxB966977954 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Sun, 7 Oct 2018 08:31:59 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 99AECAE045; Sun, 7 Oct 2018 11:30:46 +0100 (BST) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 06BBFAE04D; Sun, 7 Oct 2018 11:30:45 +0100 (BST) Received: from rapoport-lnx (unknown [9.148.8.161]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Sun, 7 Oct 2018 11:30:44 +0100 (BST) Received: by rapoport-lnx (sSMTP sendmail emulation); Sun, 07 Oct 2018 11:31:56 +0300 From: Mike Rapoport To: Dennis Zhou Cc: Tejun Heo , Christoph Lameter , Roman Gushchin , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Mike Rapoport , stable@vger.kernel.org Subject: [PATCH] percpu: stop leaking bitmap metadata blocks Date: Sun, 7 Oct 2018 11:31:51 +0300 X-Mailer: git-send-email 2.7.4 X-TM-AS-GCONF: 00 x-cbid: 18100708-0008-0000-0000-0000027C0E21 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18100708-0009-0000-0000-000021E53EB9 Message-Id: <1538901111-22823-1-git-send-email-rppt@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-10-07_06:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=2 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1810070089 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP The commit ca460b3c9627 ("percpu: introduce bitmap metadata blocks") introduced bitmap metadata blocks. These metadata blocks are allocated whenever a new chunk is created, but they are never freed. Fix it. Fixes: ca460b3c9627 ("percpu: introduce bitmap metadata blocks") Signed-off-by: Mike Rapoport Cc: stable@vger.kernel.org --- mm/percpu.c | 1 + 1 file changed, 1 insertion(+) diff --git a/mm/percpu.c b/mm/percpu.c index d21cb13..25104cd 100644 --- a/mm/percpu.c +++ b/mm/percpu.c @@ -1212,6 +1212,7 @@ static void pcpu_free_chunk(struct pcpu_chunk *chunk) { if (!chunk) return; + pcpu_mem_free(chunk->md_blocks); pcpu_mem_free(chunk->bound_map); pcpu_mem_free(chunk->alloc_map); pcpu_mem_free(chunk);