Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1041657imu; Fri, 11 Jan 2019 13:56:49 -0800 (PST) X-Google-Smtp-Source: ALg8bN4mWTOZa42oncpxD0NWy1VpOYoYCDqKLwYHS/khVVN5eDCl/nxaNNPcCQm6iAv/Th1SnANd X-Received: by 2002:a17:902:7c82:: with SMTP id y2mr16037315pll.33.1547243809582; Fri, 11 Jan 2019 13:56:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547243809; cv=none; d=google.com; s=arc-20160816; b=kTFnDnKUxgU507k8wbhPlnym9frlHJen8TcPlRf4IzvSJ4/U7oBfO2PW0d0WOeDNwG lHaulNs5X/OQwS2Fd5e3UsLmaUnFh5Gx7xs+EpreZtgrTlk9x6Y0yksH8RYN7q+zL+gf bqZthiwMyejA31P5Cq6F8hKwmjY1By1p1353KgLbnl7dLYie2fb8wi6UmezP/nZZbxvf 4jM3os80AzQZLXLBApZiiJ2NkkyyoJu9zj6TIz3Lz+0sCZ0BamScz3OHw3CnsdR8M9vo XLM3xUJH0ZA1yQGvrhQwFmWV9XraL/HAGbJjtb0sAIUu6lrD+D1SOspm+9Yel10eQ5hy oH/w== 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; bh=D3Oj8sKXvGqHi6IopfYjRYNr7WWYUVCQR8R+pO/FUyk=; b=r2W34J8Ekxdv8JJfIm64OmsF/klakGysfPSt9y2jeInv7Zo/qMQQR+/wW75VdLmwTb kKPk4QCCsLrRkoyBoo0ou1JjPw77MzlnXZpBn4MImgQY9WgM+h6lkAdYZEH23ozHvc9s B/nKxrnfPy5Sn/9S17FVhKx2cO7Bk5K3ZK/bFvzBuAa8R6TmqO+gvnARu67Hn511iAKi xP9ggfObMo2FApTPL9sQ5yjWzTQPTT+2fpy1JoQEW7UGqYcjuHdwU8YGG5XqEcx/RSPq 9Rgl/Tc2uIKa7VpANyrbVsRVnawhENhETxZCs5TEjf6eI140gXz4bh6CUUdXe+y01kH7 npNA== 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=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w11si10413830pgf.452.2019.01.11.13.56.33; Fri, 11 Jan 2019 13:56:49 -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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726016AbfAKVzL (ORCPT + 99 others); Fri, 11 Jan 2019 16:55:11 -0500 Received: from mga14.intel.com ([192.55.52.115]:33368 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725536AbfAKVzK (ORCPT ); Fri, 11 Jan 2019 16:55:10 -0500 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Jan 2019 13:55:10 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,466,1539673200"; d="scan'208";a="114054591" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga007.fm.intel.com with ESMTP; 11 Jan 2019 13:55:07 -0800 Received: by black.fi.intel.com (Postfix, from userid 1000) id 04A82F7; Fri, 11 Jan 2019 23:55:06 +0200 (EET) Date: Sat, 12 Jan 2019 00:55:06 +0300 From: "Kirill A. Shutemov" To: Mike Kravetz Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Hugh Dickins , Michal Hocko , Dan Williams , Matthew Wilcox , Toshi Kani , Boaz Harrosh , Andrew Morton Subject: Re: [RFC PATCH] mm: align anon mmap for THP Message-ID: <20190111215506.jmp2s5end2vlzhvb@black.fi.intel.com> References: <20190111201003.19755-1-mike.kravetz@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190111201003.19755-1-mike.kravetz@oracle.com> User-Agent: NeoMutt/20170714-126-deb55f (1.8.3) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 11, 2019 at 08:10:03PM +0000, Mike Kravetz wrote: > At LPC last year, Boaz Harrosh asked why he had to 'jump through hoops' > to get an address returned by mmap() suitably aligned for THP. It seems > that if mmap is asking for a mapping length greater than huge page > size, it should align the returned address to huge page size. > > THP alignment has already been added for DAX, shm and tmpfs. However, > simple anon mappings does not take THP alignment into account. In general case, when no hint address provided, all anonymous memory requests have tendency to clamp into a single bigger VMA and get you better chance having THP, even if a single allocation is too small. This patch will *reduce* the effect and I guess the net result will be net negative. The patch also effectively reduces bit available for ASLR and increases address space fragmentation (increases number of VMA and therefore page fault cost). I think any change in this direction has to be way more data driven. -- Kirill A. Shutemov