Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp968838imm; Fri, 15 Jun 2018 09:03:37 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJfNkm2wi3BgYj27GRb8ePQLzHqtnWLAgmx9AmEIYEODxBF6aefK0quVxrWMabYdVIm2C6g X-Received: by 2002:a17:902:4c88:: with SMTP id b8-v6mr2609803ple.285.1529078617052; Fri, 15 Jun 2018 09:03:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529078617; cv=none; d=google.com; s=arc-20160816; b=t93jcGnWkfWTtxCrKl1dEZA3+WYaZL4l3D1tQMOI+68VClZi/E3KpO04n8ZjcnsN93 iWjMHYdaXM6Ywfg04fjsS1Sr8Yhj+9da17F/s8cyJRxqDeen2wMi4hQnsEkWFdJLJ+Na w2eEtWWdKZK7sGzSdDurCFFiXMkItNn7whRF74HGeLcUVz1+3XR29eUkh20ZjB62xtRT qRNvs1k6J/3cv6dY5IOA/Vb6nEzHNiY2+PXxEy+Ok3UWxUZ3qUD4/4zRB+PSaaCqXqg5 rBZCq8V29UpXqbuCV5ovCERySmcndHkkVkLUqWvk68qP30zidDeB1kyFGc/HMmjZr/zm FMkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature :arc-authentication-results; bh=wYQ66LD5VUuFPy3szLXDE6z0vGCUwqAaMx7o9Sz0jTI=; b=btcSyW8by5xmGGAKLqpyAWaPc0Q2oDzBhDcwZB5q+d475y8RnmsW9vhTwhKEspdghx zjMGUUoZc5jDY3BP5XNaNnO6cbfm8l1MyLBvIj9iNA3zkAYf6wzRC8U+k6RfLTOixVqd J40VEnHka25SjCQHdGNt0yD2GI+EATpJy9sDMyQIXfu1NKJDISRQBkLXFFBc4tAj/vWE UuNWa9HfWsMj3Y8hMsEImM305IBOQd8fr9rlVWRMQNsIKp895wt+kZnen9nK9oy30YNE 6V1qEPgcEBwXsCRlEgRjCmcW8D/KWjT9AHavFX8JXKbLoiSbOYUtGDgcZTycq14hWdoW G4xw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=YCQjHxZn; 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=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l23-v6si7996393pfg.326.2018.06.15.09.03.21; Fri, 15 Jun 2018 09:03:37 -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; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=YCQjHxZn; 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=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965962AbeFOQC5 (ORCPT + 99 others); Fri, 15 Jun 2018 12:02:57 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:36238 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965593AbeFOQC4 (ORCPT ); Fri, 15 Jun 2018 12:02:56 -0400 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w5FFxwgE006452 for ; Fri, 15 Jun 2018 16:02:55 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : references : in-reply-to : from : date : message-id : subject : to : cc : content-type; s=corp-2017-10-26; bh=wYQ66LD5VUuFPy3szLXDE6z0vGCUwqAaMx7o9Sz0jTI=; b=YCQjHxZnUG7wVLzIcEXce9B6IoIZ5iR7/Id2QBPXCjxWGqzHgZblUGJT1755SfUV0mRK YzS9HTAHnmqmPSkYcc2KNrW8LLQE5DmgBhtsET2meZSo6Fe5R80Z+e4kgH5jOeq4n++4 eVG8mVM4ko5kHp7MOBezI6wjZMYZlbklj3SSY10mUcYblJVWPoE0KfAbhtG4CHk4t7rS YS2N8lgyN7YCbzFJfNhiO1lPy2KfTk3xrRdclsLMxYgdxJQsEGa7S3bDuiYzJe/LrC4W N7cIyNntefhNZsVB4Glqsr9x4ZBrFBZK5k7znWA3wuXErXc3rctsc9jOJKaILb+cHUCa AA== Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by aserp2120.oracle.com with ESMTP id 2jk0xrskqe-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Fri, 15 Jun 2018 16:02:55 +0000 Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w5FG2slF007623 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Fri, 15 Jun 2018 16:02:54 GMT Received: from abhmp0011.oracle.com (abhmp0011.oracle.com [141.146.116.17]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w5FG2sXa029369 for ; Fri, 15 Jun 2018 16:02:54 GMT Received: from mail-ot0-f171.google.com (/74.125.82.171) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 15 Jun 2018 09:02:54 -0700 Received: by mail-ot0-f171.google.com with SMTP id w9-v6so11518018otj.7 for ; Fri, 15 Jun 2018 09:02:54 -0700 (PDT) X-Gm-Message-State: APt69E1VfCV/M28L4u37CQYV4PD/ZGPmWGatKhEb7sE6CyXwb2qYc6ae LKhXsY3g9ccT/AQ6AySj2We0Rs2ZiAVnWg4j1sE= X-Received: by 2002:a9d:ef7:: with SMTP id 110-v6mr1249571otj.323.1529078573862; Fri, 15 Jun 2018 09:02:53 -0700 (PDT) MIME-Version: 1.0 References: <20180613054107.GA5329@hori1.linux.bs1.fc.nec.co.jp> <20180613090700.GG13364@dhcp22.suse.cz> <20180614051618.GB17860@hori1.linux.bs1.fc.nec.co.jp> <20180614053859.GA9863@techadventures.net> <20180614063454.GA32419@hori1.linux.bs1.fc.nec.co.jp> <20180614213033.GA19374@techadventures.net> <20180615010927.GC1196@hori1.linux.bs1.fc.nec.co.jp> <20180615072947.GB23273@hori1.linux.bs1.fc.nec.co.jp> <20180615084142.GE24039@dhcp22.suse.cz> <20180615140000.44tht4f3ek3lh2u2@xakep.localdomain> <20180615143308.GA26321@techadventures.net> In-Reply-To: <20180615143308.GA26321@techadventures.net> From: Pavel Tatashin Date: Fri, 15 Jun 2018 12:02:17 -0400 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3] x86/e820: put !E820_TYPE_RAM regions into memblock.reserved To: osalvador@techadventures.net Cc: mhocko@kernel.org, n-horiguchi@ah.jp.nec.com, Linux Memory Management List , osalvador@suse.de, Steven Sistare , Daniel Jordan , willy@infradead.org, LKML , Andrew Morton , mingo@kernel.org, dan.j.williams@intel.com, ying.huang@intel.com Content-Type: text/plain; charset="UTF-8" X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8925 signatures=668702 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=3 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=934 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1805220000 definitions=main-1806150171 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > Hi Pavel, > > I think this makes a lot of sense. > Since Naoya is out until Wednesday, maybe I give it a shot next week and see if I can gather some numbers. Hi Oscar, Thank you for the offer to do this. Since, sched_clock() is not yet initialized at the time zero_resv_unavail() is called, it is difficult to measure it during boot. But, I had x86 early boot timestamps patches handy, so I could measure, thus decided to submit the patch. http://lkml.kernel.org/r/20180615155733.1175-1-pasha.tatashin@oracle.com Thank you, Pavel > > > > > Thank you, > > Pasha > > > > > > > > > --- > > > > arch/x86/kernel/e820.c | 15 ++++++++++++--- > > > > 1 file changed, 12 insertions(+), 3 deletions(-) > > > > > > > > diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c > > > > index d1f25c831447..c88c23c658c1 100644 > > > > --- a/arch/x86/kernel/e820.c > > > > +++ b/arch/x86/kernel/e820.c > > > > @@ -1248,6 +1248,7 @@ void __init e820__memblock_setup(void) > > > > { > > > > int i; > > > > u64 end; > > > > + u64 addr = 0; > > > > > > > > /* > > > > * The bootstrap memblock region count maximum is 128 entries > > > > @@ -1264,13 +1265,21 @@ void __init e820__memblock_setup(void) > > > > struct e820_entry *entry = &e820_table->entries[i]; > > > > > > > > end = entry->addr + entry->size; > > > > + if (addr < entry->addr) > > > > + memblock_reserve(addr, entry->addr - addr); > > > > + addr = end; > > > > if (end != (resource_size_t)end) > > > > continue; > > > > > > > > + /* > > > > + * all !E820_TYPE_RAM ranges (including gap ranges) are put > > > > + * into memblock.reserved to make sure that struct pages in > > > > + * such regions are not left uninitialized after bootup. > > > > + */ > > > > if (entry->type != E820_TYPE_RAM && entry->type != E820_TYPE_RESERVED_KERN) > > > > - continue; > > > > - > > > > - memblock_add(entry->addr, entry->size); > > > > + memblock_reserve(entry->addr, entry->size); > > > > + else > > > > + memblock_add(entry->addr, entry->size); > > > > } > > > > > > > > /* Throw away partial pages: */ > > > > -- > > > > 2.7.4 > > > > > > -- > > > Michal Hocko > > > SUSE Labs > > > > > > > Best Regards > Oscar Salvador >