Received: by 10.223.176.5 with SMTP id f5csp4019043wra; Tue, 30 Jan 2018 00:31:04 -0800 (PST) X-Google-Smtp-Source: AH8x224M4ASvs0YNGOLLKjgkTDkbgqai0WeJa0W2MructYn0+4FAoC+NBNIUKhV5eZm6004yKl6x X-Received: by 10.98.194.8 with SMTP id l8mr29718282pfg.26.1517301064065; Tue, 30 Jan 2018 00:31:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517301064; cv=none; d=google.com; s=arc-20160816; b=au+fDmPC0tXMtKR1fxEmzKwl0HBAKn4/h1rk921O4OwVcgTHbEcaTwqdSLHgyTCjD7 Yy7rt9zZ8jI+vzBLkiBlbftKbhdVsT1O3IjIVH4ICtxeTUGNMmYm5bxnd+usXZ0kGjX8 QNBNzRo5oqMJgCJoLL6IOYnPPLq1R8nuxGnqufnsgr9RXYJiGKjsDc1nJ5lxrdJ6Oo/C I2fpobB9xrJvJzkowwZECrISFL7OqLZqtD98ZJpX51pELXfhqulmG5xRxYAAmiuVQcS8 5EbchDoYO/tkTgqSFLLMcm/hLVXLIrQqooeSYGLfuaUNvck8I+PzCVpZRHz1p+0ouCsD 2YUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:user-agent:content-disposition :mime-version:reply-to:subject:cc:to:from:date :arc-authentication-results; bh=+qRe/280G4Z7QxlcRx6EEHOtTTQAIrSEJsc+Mh/VFso=; b=Ogm1pOpMfdRITy7FgSJOAOc2kw5olcpEbx+pY4ZhkvHghC+rP4IFpFg2EDEghghQrg 1TpJnjpzWOzVVlMneHleM927ePqhET0/B8IphGeLyOJfjf6oZs30p8PI+3CCdx9y9tFh Os+PkZusou8M/V2Nzy06xGNAmFBeiYIOGJoK73j2j9gSsKjzczvR19q+Rqe5J6j0Ash7 3tj61r7oFRk4XOnnsBTCJyaHPPBgjAdr1c/fqAQlaMQKVYDU7hSwMtnGuFV7ik7EKuPd Xb23lsSG0lFPrI3GBPCiZt5RWknYaDWp0U0PJcv/XZDcDXN14i1PzD0yZWoshuxgM7OY Ynqw== 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 n4si1361906pfb.23.2018.01.30.00.30.49; Tue, 30 Jan 2018 00:31:04 -0800 (PST) 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 S1751903AbeA3IaS (ORCPT + 99 others); Tue, 30 Jan 2018 03:30:18 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:50756 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751759AbeA3IaQ (ORCPT ); Tue, 30 Jan 2018 03:30:16 -0500 Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w0U8TB93127851 for ; Tue, 30 Jan 2018 03:30:16 -0500 Received: from e06smtp12.uk.ibm.com (e06smtp12.uk.ibm.com [195.75.94.108]) by mx0a-001b2d01.pphosted.com with ESMTP id 2ftkcyvfyp-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Tue, 30 Jan 2018 03:30:15 -0500 Received: from localhost by e06smtp12.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 30 Jan 2018 08:30:12 -0000 Received: from b06cxnps3075.portsmouth.uk.ibm.com (9.149.109.195) by e06smtp12.uk.ibm.com (192.168.101.142) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 30 Jan 2018 08:30:10 -0000 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w0U8U9AC64684252; Tue, 30 Jan 2018 08:30:09 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B085C11C052; Tue, 30 Jan 2018 08:23:40 +0000 (GMT) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1A45A11C064; Tue, 30 Jan 2018 08:23:40 +0000 (GMT) Received: from in.ibm.com (unknown [9.124.35.20]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Tue, 30 Jan 2018 08:23:39 +0000 (GMT) Date: Tue, 30 Jan 2018 14:00:06 +0530 From: Bharata B Rao To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: pasha.tatashin@oracle.com Subject: Memory hotplug not increasing the total RAM Reply-To: bharata@linux.vnet.ibm.com MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.7.1 (2016-10-04) X-TM-AS-GCONF: 00 x-cbid: 18013008-0008-0000-0000-000004C75880 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18013008-0009-0000-0000-00001E5AEDAA Message-Id: <20180130083006.GB1245@in.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-01-30_05:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1801300108 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, With the latest upstream, I see that memory hotplug is not working as expected. The hotplugged memory isn't seen to increase the total RAM pages. This has been observed with both x86 and Power guests. 1. Memory hotplug code intially marks pages as PageReserved via __add_section(). 2. Later the struct page gets cleared in __init_single_page(). 3. Next online_pages_range() increments totalram_pages only when PageReserved is set. The step 2 has been introduced recently by the following commit: commit f7f99100d8d95dbcf09e0216a143211e79418b9f Author: Pavel Tatashin Date: Wed Nov 15 17:36:44 2017 -0800 mm: stop zeroing memory during allocation in vmemmap Reverting this commit restores the correct behaviour of memory hotplug. Regards, Bharata.