From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932278AbdJXIKK (ORCPT ); Tue, 24 Oct 2017 04:10:10 -0400 Received: from mout.gmx.net ([212.227.17.20]:62243 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932252AbdJXIKE (ORCPT ); Tue, 24 Oct 2017 04:10:04 -0400 Subject: Re: PROBLEM: Remapping hugepages mappings causes kernel to return EINVAL To: Mike Kravetz Cc: Michal Hocko , linux-mm@kvack.org, linux-kernel , Andrea Arcangeli , "Kirill A. Shutemov" , Vlastimil Babka References: <93684e4b-9e60-ef3a-ba62-5719fdf7cff9@gmx.de> <6b639da5-ad9a-158c-ad4a-7a4e44bd98fc@gmx.de> <5fb8955d-23af-ec85-a19f-3a5b26cc04d1@oracle.com> <20171023114210.j7ip75ewoy2tiqs4@dhcp22.suse.cz> <20171023124122.tjmrbcwo2btzk3li@dhcp22.suse.cz> <20171023161316.ajrxgd2jzo3u52eu@dhcp22.suse.cz> <93ffc1c8-3401-2bea-732a-17d373d2f24c@gmx.de> <20171023165717.qx5qluryshz62zv5@dhcp22.suse.cz> <4d855be6-7718-f428-91d6-d0c6b44b7ff4@oracle.com> From: "C.Wehrmeyer" Message-ID: <64606243-e770-f5f6-e9dc-6495ce1cb0bd@gmx.de> Date: Tue, 24 Oct 2017 10:09:19 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <4d855be6-7718-f428-91d6-d0c6b44b7ff4@oracle.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:1QylFiD7q59YHJ/MDvCT/vkLNqD/ozCLpgzz5eP3Hu6bqi5knTH wpy8LJCHfBf0s74V33EF2Xb+JmGCjZErfpt51240ccHyNEhUts6Wnm9yG2vGKzM7dsLf0OK LIX5vxFvca+AdA9nFDUoXXeqz9KqfsHVquoLZnzpSU7B0hbf4E9itX4iuqV4auUPGqVaGMT pOzWSO48LEl0wddf7NG2w== X-UI-Out-Filterresults: notjunk:1;V01:K0:2zllibIdre4=:0X4nrSgjt4jxZeqVT9CS8G T2dZt4daZwIluGSkZffTkRkPrmhNzFTO1JaIwAwQewNdTDDA+lUfJ7n8iVRSn5f2S/HziVJV5 acwi7vgMOy2+sSWe4LNvgikv2oxvFKErtrrMxijj3oKWOKxGbBrJb7qcIppGiaEJbdz60dCxe yCahodu51jLxmTrl6kSxt3XPCjiMS8B0nFz4+Yofp+krgZMf0nvbHohRo99F576RX8YpAQV/+ 3IModJRyIigWqNwtUKxyhhP8PFyWO86ujMSG0zrBpptTGTNYICxxvdndVoEQKeeJ7tg98nSsY 91BUostkTK3MDiodXT0Z42kUE+CnyUhliVQczZvsuXXy0siyBwVfNnHMVymktMx8QA8TKh8N/ Gv4i88bAd5Uv9EopxOBzGjTOe750fxQjmyw45FouIBD2Hj94TzRb4jzZsVCCjo0jGQImdRUmh HKKji/c4lV3NKDnVIR7MLULTu9FMXph6VD38NlbqRAPsY1T9CcAlmY/Z6hCqgHVTQxW95tPYa ZZ0ZRUn1qcKBgNhUw1EknuD66x0E4EX66H7K+Bf3QFyEtF3BG32fkG7HqozYeZMgNoss3k5Fe MKT0+hKYTNsDVOxexJ0jjT4OtLwX8btCvVyW0n5gc6Jcqy7gTpCCBv1dsvAWGGSLpY05dRi06 Lvho36zCDM27rAYhZtMAJWndM8JDqhTuj8i7nA+ayZ0XoooOAJ8Gl9pQSP3LTR+Y+8I+VquOu 5nFDkDC65rN8WviTWhv1nVnRpexi9xrPkfsVzfKone3n/nHrERazI623KFo+1u2/okYZU2qQK Ou0jc2pTT5A5J05uLKRfdDzRxiklQi7EIRHAUUfYA2X3PfbGMA= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2017-10-23 20:51, Mike Kravetz wrote: > [...] > Well at least this has a built in fall back mechanism. When using hugetlb(fs) > pages, you would need to handle the case where mremap fails due to lack of > configured huge pages. You're missing the point. I never asked for a fall-back mechanism, even though it certainly has its use cases. It just isn't mine. In such a situation it wouldn't be hard to detect if the user requested huger pages, and then fall back to a smaller size. The only difference is that I'd have to implement it myself. But all of that does not change the fact that it's not transparent. > I assume your allocator will be for somewhat general application usage. Define "general purpose" first. The allocator itself isn't transparent to typical malloc/realloc/free-based approaches, and it isn't so very deliberately. > Yet, > for the most reliability the user/admin will need to know at boot time how > many huge pages will be needed and set that up. That's what I'm trying to argue. With how much memory were typical 386s equipped back then? 16 MiBs? With a page size of 4 KiBs that leaves 4096 pages to map the entirety of RAM. My current testing box has 8 GiBs. If I were to map the entirety of my RAM with 2-MiB pages that would still require 4096 pages. Did anyone set up pages pools with Linux in the 90s? Did anyone complain that 4096 bytes are too much of a page size to effectively use memory?