Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp6955114imm; Wed, 27 Jun 2018 16:56:45 -0700 (PDT) X-Google-Smtp-Source: ADUXVKK2BOCsiATpA2M5zFO3F9GPhUW0pQsQF6R4aL1QTBvez9ecGrEO4RNBFxsic/O5U+UgtiVR X-Received: by 2002:a63:9741:: with SMTP id d1-v6mr6717802pgo.403.1530143805833; Wed, 27 Jun 2018 16:56:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530143805; cv=none; d=google.com; s=arc-20160816; b=L8LYYjhhbcaXWOOBmS5x/H9q/6H3kF0q/zqxGqr32u9C0Arkx66grll9kPd/ALvAQ5 yWz3TWH5p0eULbMwHG/GkdtRqbW54sVOWYHpO8nOgirSQi8HF49GM/mSRQg2ATgE6ffP rmQJTlWya/sN/YhbNK/jCQh5emH3G3urHzQsUQRyjn0UcOftQJ405XeBYtvAWtjhUqju oEMUZ3o4zRqCanczZ/D9HCuEdbC3i4wpjmnD740lgjOE/h0+US+kKS+wIS7cljQcNPho 0S72J1+u/DPFyjOS9TCkIaTnlJBqwznxL+cO9TloTZKaa9U7hMtRF+QXPEVGgNntKAoq D0Zw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=fTno1DrQ1/9tjs4c+5nefxtLYtHBMWCdCC8AnZ2suvA=; b=i+8zSEsA+MxwpaXut+1mHb+eHrH324xap59K/uOaZPOPH/X/PtjEyiyjMuylDLVoJ2 b33bzVW3b9s7/BbxBjsB39/jhhV+wq3Qo7jVxSg0HBDhQhs3PJQakF/59VlJw/F+ROck U4gP1cH49vONo0BVrw2PYIUY6/jEab1fkSYmV8gR+WeHTBUs4Qye4n4VeCcJYLtCjInR PiWytrvs08ZtISwkU942B9uynseiD2V5wn6Dv9RjbPf8bWvUZUP5F/MfFKE1+vqjWZT7 HJ+Z4Lbt11ODyak5oK6wuBUnN5h3bebi7L4xV+ZLbkts+pfxvx9fV2EN9pLzni8XmAbF SayA== 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b5-v6si4607628pgc.219.2018.06.27.16.56.31; Wed, 27 Jun 2018 16:56:45 -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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752639AbeF0Xjm (ORCPT + 99 others); Wed, 27 Jun 2018 19:39:42 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:51430 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752210AbeF0Xjl (ORCPT ); Wed, 27 Jun 2018 19:39:41 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0D4A1BF566; Wed, 27 Jun 2018 23:39:41 +0000 (UTC) Received: from localhost (ovpn-8-16.pek2.redhat.com [10.72.8.16]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0F6F32156880; Wed, 27 Jun 2018 23:39:39 +0000 (UTC) Date: Thu, 28 Jun 2018 07:39:36 +0800 From: Baoquan He To: Pavel Tatashin Cc: LKML , Andrew Morton , dave.hansen@intel.com, pagupta@redhat.com, Linux Memory Management List , kirill.shutemov@linux.intel.com Subject: Re: [PATCH v5 0/4] mm/sparse: Optimize memmap allocation during sparse_init() Message-ID: <20180627233936.GE8970@localhost.localdomain> References: <20180627013116.12411-1-bhe@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.1 (2017-09-22) X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Wed, 27 Jun 2018 23:39:41 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Wed, 27 Jun 2018 23:39:41 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'bhe@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Pavel, On 06/27/18 at 01:47pm, Pavel Tatashin wrote: > This work made me think why do we even have > CONFIG_SPARSEMEM_ALLOC_MEM_MAP_TOGETHER ? This really should be the > default behavior for all systems. Yet, it is enabled only on x86_64. > We could clean up an already messy sparse.c if we removed this config, > and enabled its path for all arches. We would not break anything > because if we cannot allocate one large mmap_map we still fallback to > allocating a page at a time the same as what happens when > CONFIG_SPARSEMEM_ALLOC_MEM_MAP_TOGETHER=n. Thanks for your idea. Seems the common ARCHes all have ARCH_SPARSEMEM_ENABLE, such as x86, arm/64, power, s390, mips, others don't have. For them, removing CONFIG_SPARSEMEM_ALLOC_MEM_MAP_TOGETHER makes sense. I will make a clean up patch to do this, but I can only test it on x86. If test robot or other issues report issue on this clean up patch, Andrew can help only pick the current 4 patches after updating, then we can continue discussing the clean up patch. From the current code, it should be OK to all ARCHes. Thanks Baoquan