From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qt0-f199.google.com (mail-qt0-f199.google.com [209.85.216.199]) by kanga.kvack.org (Postfix) with ESMTP id 1A3966B0005 for ; Tue, 30 Jan 2018 03:30:16 -0500 (EST) Received: by mail-qt0-f199.google.com with SMTP id n28so10478350qtk.7 for ; Tue, 30 Jan 2018 00:30:16 -0800 (PST) Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com. [148.163.158.5]) by mx.google.com with ESMTPS id 8si3952818qku.255.2018.01.30.00.30.15 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 30 Jan 2018 00:30:15 -0800 (PST) Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w0U8TaHp132875 for ; Tue, 30 Jan 2018 03:30:14 -0500 Received: from e06smtp12.uk.ibm.com (e06smtp12.uk.ibm.com [195.75.94.108]) by mx0b-001b2d01.pphosted.com with ESMTP id 2ftmqbhdy7-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Tue, 30 Jan 2018 03:30:14 -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 Date: Tue, 30 Jan 2018 14:00:06 +0530 From: Bharata B Rao 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 Message-Id: <20180130083006.GB1245@in.ibm.com> Sender: owner-linux-mm@kvack.org List-ID: To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: pasha.tatashin@oracle.com 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. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751916AbeA3IaS (ORCPT ); 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 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 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.