Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp371511ybd; Tue, 25 Jun 2019 23:13:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqyNIQLXBnmVoD9tS5Mq8K4LGK9kMNlGpJde98dCCqCnTwq/1dEi2OxltutoGHlHL7GlpVq3 X-Received: by 2002:a63:dc09:: with SMTP id s9mr1203618pgg.425.1561529588271; Tue, 25 Jun 2019 23:13:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561529588; cv=none; d=google.com; s=arc-20160816; b=NQK6xNa+wYwJoNiPcAX503PF9zIWKHXo9MtEZ9xvOPOZkP6kJR7xG5uQXqibXBEDO+ gPJ16onoHrgEzY2xaX1py4fnL8iuToDy8rl54HEx4XMiJ56mFSPWnOQTr9cKlDfRjnzq K2QKne13AcyKsnXuOu+46z6mDdoU/AZmRh08ZWP9RsaGUAAtAcCMWghICopBEbBOMH+T LYwczyLb+NVDZWh97meGaX2uH+PiUYUWLtwu3aMhOXe5JVE/YP1gtm+bx+Y/c9K0sWCP SOm1nwZIBTyjkftym1+aRaSRvkiVwCgHyujUFC4Ha2L1V9Jrxor8B2TBeQDeGjYXklLN OwjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:content-transfer-encoding :mime-version:references:in-reply-to:date:subject:cc:to:from; bh=FngNSEjVr0gOwVr44YRwnoW9tR97PzgW3sZ5tY6OUkQ=; b=m2Q4LAidqW6s/ijSsFV3I9gxGYYEe3JtWvU4CvHr46EYRrCuB770JWj/QlVvbgarLJ l5TjDsqC6vnliXDqBSC6Ls9NKmUMdZh6zU985H6lx2WVlk3/g25r0J9CVnIkFen/F4xQ 8EhYxBkDdNhBkgRiKrIpNxsshZlDyG7P6ATwHAIpdsC0i7ODJ5XnDbt0y+caEk66RzC2 cFFStjNV5rJWaHWIJEdmUwzmoO0AyHgvfLBQpU7e9QoAIEGw0VqrCWEeATuwcOYhxoXd 5+Ypy8sySRX0XfOPl+sa1lFdbJDZHn2+oZCPemb6y6G+n9I5RnnP33LwKF/J2DLI+7JC oo6w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j17si15941404pfr.13.2019.06.25.23.12.46; Tue, 25 Jun 2019 23:13:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726787AbfFZGLz (ORCPT + 99 others); Wed, 26 Jun 2019 02:11:55 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:16164 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726756AbfFZGLv (ORCPT ); Wed, 26 Jun 2019 02:11:51 -0400 Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x5Q68WNH087460 for ; Wed, 26 Jun 2019 02:11:50 -0400 Received: from e06smtp05.uk.ibm.com (e06smtp05.uk.ibm.com [195.75.94.101]) by mx0a-001b2d01.pphosted.com with ESMTP id 2tc01fdpdq-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 26 Jun 2019 02:11:49 -0400 Received: from localhost by e06smtp05.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 26 Jun 2019 07:11:46 +0100 Received: from b06cxnps4075.portsmouth.uk.ibm.com (9.149.109.197) by e06smtp05.uk.ibm.com (192.168.101.135) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Wed, 26 Jun 2019 07:11:42 +0100 Received: from b06wcsmtp001.portsmouth.uk.ibm.com (b06wcsmtp001.portsmouth.uk.ibm.com [9.149.105.160]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x5Q6BfoY41025540 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 26 Jun 2019 06:11:41 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7EB9CA4054; Wed, 26 Jun 2019 06:11:41 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2A885A405C; Wed, 26 Jun 2019 06:11:41 +0000 (GMT) Received: from ozlabs.au.ibm.com (unknown [9.192.253.14]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 26 Jun 2019 06:11:41 +0000 (GMT) Received: from adsilva.ozlabs.ibm.com (haven.au.ibm.com [9.192.254.114]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.au.ibm.com (Postfix) with ESMTPSA id 18A61A01B9; Wed, 26 Jun 2019 16:11:40 +1000 (AEST) From: "Alastair D'Silva" To: alastair@d-silva.org Cc: Greg Kroah-Hartman , "Rafael J. Wysocki" , Andrew Morton , Pavel Tatashin , Oscar Salvador , Michal Hocko , Mike Rapoport , Baoquan He , Wei Yang , Logan Gunthorpe , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH v2 3/3] mm: Don't manually decrement num_poisoned_pages Date: Wed, 26 Jun 2019 16:11:23 +1000 X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190626061124.16013-1-alastair@au1.ibm.com> References: <20190626061124.16013-1-alastair@au1.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 x-cbid: 19062606-0020-0000-0000-0000034D7215 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19062606-0021-0000-0000-000021A0E536 Message-Id: <20190626061124.16013-4-alastair@au1.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-06-26_02:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=767 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1906260074 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Alastair D'Silva Use the function written to do it instead. Signed-off-by: Alastair D'Silva --- mm/sparse.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mm/sparse.c b/mm/sparse.c index 1ec32aef5590..d9b3625bfdf0 100644 --- a/mm/sparse.c +++ b/mm/sparse.c @@ -11,6 +11,8 @@ #include #include #include +#include +#include #include "internal.h" #include @@ -772,7 +774,7 @@ static void clear_hwpoisoned_pages(struct page *memmap, for (i = start; i < start + count; i++) { if (PageHWPoison(&memmap[i])) { - atomic_long_sub(1, &num_poisoned_pages); + num_poisoned_pages_dec(); ClearPageHWPoison(&memmap[i]); } } -- 2.21.0