From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752335AbdLFVV3 (ORCPT ); Wed, 6 Dec 2017 16:21:29 -0500 Received: from hqemgate15.nvidia.com ([216.228.121.64]:19614 "EHLO hqemgate15.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751718AbdLFVV0 (ORCPT ); Wed, 6 Dec 2017 16:21:26 -0500 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Wed, 06 Dec 2017 13:21:25 -0800 Subject: Re: [PATCH v2] mmap.2: MAP_FIXED updated documentation To: Cyril Hrubis CC: Michal Hocko , Michael Kerrisk , linux-man , , Michael Ellerman , , LKML , , Jann Horn , Matthew Wilcox References: <20171204021411.4786-1-jhubbard@nvidia.com> <20171204105549.GA31332@rei> <20171205070510.aojohhvixijk3i27@dhcp22.suse.cz> <2cff594a-b481-269d-dd91-ff2cc2f4100a@nvidia.com> <20171206100118.GA13979@rei> X-Nvconfidentiality: public From: John Hubbard Message-ID: Date: Wed, 6 Dec 2017 13:21:25 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <20171206100118.GA13979@rei> X-Originating-IP: [10.110.48.28] X-ClientProxiedBy: HQMAIL104.nvidia.com (172.18.146.11) To HQMAIL107.nvidia.com (172.20.187.13) Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/06/2017 02:01 AM, Cyril Hrubis wrote: > Hi! >> (It does seem unfortunate that the man page cannot help the programmer >> actually write correct code here. He or she is forced to read the kernel >> implementation, in order to figure out the true alignment rules. I was >> hoping we could avoid that.) > > It would be nice if we had this information exported somehere so that we > do not have to rely on per-architecture ifdefs. > > What about adding MapAligment or something similar to the /proc/meminfo? > What's the use case you envision for that? I don't see how that would be better than using SHMLBA, which is available at compiler time. Because unless someone expects to be able to run an app that was compiled for Arch X, on Arch Y (surely that's not requirement here?), I don't see how the run-time check is any better. Or maybe you're thinking that since the SHMLBA cannot be put in the man pages, we could instead provide MapAlignment as sort of a different way to document the requirement? -- thanks, John Hubbard NVIDIA