Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp656509imm; Fri, 13 Jul 2018 04:12:11 -0700 (PDT) X-Google-Smtp-Source: AAOMgpccpRWVfxsvspzFVPf9Wi+OInUvbx5r1cQVips0c0GPNmeBE3BGT8K53sjA2u7YKUe1FHDB X-Received: by 2002:a17:902:42c3:: with SMTP id h61-v6mr5966120pld.319.1531480331116; Fri, 13 Jul 2018 04:12:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531480331; cv=none; d=google.com; s=arc-20160816; b=EzXxMMVfJaGtM8Qi/FOGaqAVxJtOpjHF+bDympn9PrryAnez7sHsi4R/WAW2hAcfDY 3rEOwH8AKMXVgHwGN6DJJfnnQ9bDlCVqEk5NyGECgwrO1FupPflI59oEhXXlAzEWqK5o t8fvsx+nGuqnmNEEFYwGWfnfgALH7dTfA46WmfxfxlG8A3Ne8PiKTwJTqUKLUt6lp9K5 cwx3RA7GtRywJlX3igPkyp+tW9VxS3muk1VVapaG6l16S2m5qk8MA+Dt6PKo7GVuI9dr sNi2srRmFdsUQ14tbqhGrCqTVj1xe4IJ/E+xd9Pb8EUGLbKNezyv8YkVf35UpqN8XjeR 8IpA== 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=Y6rkzpdUVm1ogzKSqKirwvVGObETzHyD6kawtwV/hhQ=; b=DvQmR42mrLVxl8+xLVy9RoDb/U3hCzQHM3s9ck/OQuhbwHaTC5gUnUXrZdBSnzV2Kr LnBawqbGSaTS+ZXA8a8wBlJpjoqoLTXFXtzso1ECiV6yD5kJtA/lYrMZnNBVECWyAYzx r7/lRRJFbbmr44oLaOirgxqtE9+yAvKJd6xf6zIb8Iul/r+PRWThS0b1z7faQmQkftVR oaGL2d/gVwravE8qHiDd6xavctTCJsCkjuGKaN81SaD3heLdkHQ56sKgzMg5d/aqN+KE wceEJZUGNqkOlWbDDP1LpMh8Jraj7jSkII5GFCS68q94bXGukB1S7cHhOvx5nx+Uxii2 FR8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=hKTiaZnb; 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 u6-v6si23727817pld.74.2018.07.13.04.11.55; Fri, 13 Jul 2018 04:12:11 -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-2018-07-02 header.b=hKTiaZnb; 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 S1727435AbeGMLZd (ORCPT + 99 others); Fri, 13 Jul 2018 07:25:33 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:53106 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727255AbeGMLZd (ORCPT ); Fri, 13 Jul 2018 07:25:33 -0400 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w6DB3tCQ141842 for ; Fri, 13 Jul 2018 11:11:20 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-2018-07-02; bh=Y6rkzpdUVm1ogzKSqKirwvVGObETzHyD6kawtwV/hhQ=; b=hKTiaZnbwPM0QAH5Dxo0X4NoSzE44+Saae+3fvlNZg/lQll1pLxUN6bgSEj4fkkpC2U7 HJOl3oz4MeXdlGf9hjpPN6ybaFo59y9WG8FCjv/cLG9ZGKbWTNi2aptvnT2JDZbY/9JM Ck7zMUu2kILWMX7qOWvT/KtVf4Y0J4H4eKI4tQ/GGOVzO5f8PYr94FQEn7QynVFXASBP Xz5QLoP0VpHzaupZPiN4fHPOgjZfRsGKYz2FIgSRRkLEtP6EQ//Y2JaoX1NCtjhDZfqT +X309CEc+psrdrr84N0zpRgFxBWScIKUqWxvdQ0qtsTg2XxrmL8rz++dCv030P1M2mS8 JA== Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp2130.oracle.com with ESMTP id 2k2p76fbk0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Fri, 13 Jul 2018 11:11:19 +0000 Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w6DBBJUn015476 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Fri, 13 Jul 2018 11:11:19 GMT Received: from abhmp0019.oracle.com (abhmp0019.oracle.com [141.146.116.25]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w6DBBIs6002248 for ; Fri, 13 Jul 2018 11:11:19 GMT Received: from mail-oi0-f47.google.com (/209.85.218.47) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 13 Jul 2018 04:11:18 -0700 Received: by mail-oi0-f47.google.com with SMTP id k12-v6so61487965oiw.8 for ; Fri, 13 Jul 2018 04:11:18 -0700 (PDT) X-Gm-Message-State: AOUpUlG94PkHtu4nbLmLxcd44IHW5o2qhJMb0mvvFYd3iodiBZ55GpS1 R1RhOM+vC+7o6ipBsrPn3W0emTBcSSdv5yk6BHY= X-Received: by 2002:aca:3bc2:: with SMTP id i185-v6mr6894561oia.156.1531480278151; Fri, 13 Jul 2018 04:11:18 -0700 (PDT) MIME-Version: 1.0 References: <20180712203730.8703-1-pasha.tatashin@oracle.com> <20180713095934.GB15039@techadventures.net> In-Reply-To: <20180713095934.GB15039@techadventures.net> From: Pavel Tatashin Date: Fri, 13 Jul 2018 07:10:42 -0400 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v5 0/5] sparse_init rewrite To: osalvador@techadventures.net Cc: Steven Sistare , Daniel Jordan , LKML , Andrew Morton , kirill.shutemov@linux.intel.com, Michal Hocko , Linux Memory Management List , dan.j.williams@intel.com, jack@suse.cz, jglisse@redhat.com, Souptick Joarder , bhe@redhat.com, gregkh@linuxfoundation.org, Vlastimil Babka , Wei Yang , dave.hansen@intel.com, rientjes@google.com, mingo@kernel.org, abdhalee@linux.vnet.ibm.com, mpe@ellerman.id.au Content-Type: text/plain; charset="UTF-8" X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8952 signatures=668706 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=3 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=819 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1806210000 definitions=main-1807130089 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > About PPC64, your patchset fixes the issue as the population gets followed by a > sparse_init_one_section(). > > It can be seen here: > > Before: > > kernel: vmemmap_populate f000000000000000..f000000000004000, node 0 > kernel: * f000000000000000..f000000000010000 allocated at (____ptrval____) > kernel: vmemmap_populate f000000000000000..f000000000008000, node 0 > kernel: * f000000000000000..f000000000010000 allocated at (____ptrval____) > kernel: vmemmap_populate f000000000000000..f00000000000c000, node 0 > kernel: * f000000000000000..f000000000010000 allocated at (____ptrval____) > > > After: > > kernel: vmemmap_populate f000000000000000..f000000000004000, node 0 > kernel: * f000000000000000..f000000000010000 allocated at (____ptrval____) > kernel: vmemmap_populate f000000000000000..f000000000008000, node 0 > kernel: vmemmap_populate f000000000000000..f00000000000c000, node 0 > kernel: vmemmap_populate f000000000000000..f000000000010000, node 0 > kernel: vmemmap_populate f000000000010000..f000000000014000, node 0 > kernel: * f000000000010000..f000000000020000 allocated at (____ptrval____) > > > As can be seen, before the patchset, we keep calling vmemmap_create_mapping() even if we > populated that section already, because of vmemmap_populated() checking for SECTION_HAS_MEM_MAP. > > After the patchset, since each population is being followed by a call to sparse_init_one_section(), > when vmemmap_populated() gets called, we have SECTION_HAS_MEM_MAP already in case the section > was populated. Hi Oscar, Right, I also like that this solution removes one extra loop, thus reduces the code size. We were populating pages in one place, and then loop again to set sections, now we do both in one place, but still allow preallocation of memory to reduces fragmentation on all platforms. However, I still wanted to see if someone could test on real hardware. Thank you, Pavel