Re: [PATCH v2] mmap.2: MAP_FIXED updated documentation

2017-12-09 Thread John Hubbard
On 12/09/2017 09:19 AM, Pavel Machek wrote: > On Thu 2017-12-07 15:02:21, Michal Hocko wrote: >> On Thu 07-12-17 13:58:05, 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

Re: [PATCH v2] mmap.2: MAP_FIXED updated documentation

2017-12-09 Thread John Hubbard
On 12/09/2017 09:19 AM, Pavel Machek wrote: > On Thu 2017-12-07 15:02:21, Michal Hocko wrote: >> On Thu 07-12-17 13:58:05, 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

Re: [PATCH v2] mmap.2: MAP_FIXED updated documentation

2017-12-09 Thread Pavel Machek
On Thu 2017-12-07 15:02:21, Michal Hocko wrote: > On Thu 07-12-17 13:58:05, 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 > > > >>

Re: [PATCH v2] mmap.2: MAP_FIXED updated documentation

2017-12-09 Thread Pavel Machek
On Thu 2017-12-07 15:02:21, Michal Hocko wrote: > On Thu 07-12-17 13:58:05, 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 > > > >>

Re: [PATCH v2] mmap.2: MAP_FIXED updated documentation

2017-12-07 Thread Cyril Hrubis
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

Re: [PATCH v2] mmap.2: MAP_FIXED updated documentation

2017-12-07 Thread Cyril Hrubis
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

Re: [PATCH v2] mmap.2: MAP_FIXED updated documentation

2017-12-07 Thread Michal Hocko
On Thu 07-12-17 13:58:05, 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 > > >>

Re: [PATCH v2] mmap.2: MAP_FIXED updated documentation

2017-12-07 Thread Michal Hocko
On Thu 07-12-17 13:58:05, 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 > > >>

Re: [PATCH v2] mmap.2: MAP_FIXED updated documentation

2017-12-06 Thread John Hubbard
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

Re: [PATCH v2] mmap.2: MAP_FIXED updated documentation

2017-12-06 Thread John Hubbard
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

Re: [PATCH v2] mmap.2: MAP_FIXED updated documentation

2017-12-06 Thread Cyril Hrubis
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

Re: [PATCH v2] mmap.2: MAP_FIXED updated documentation

2017-12-06 Thread Cyril Hrubis
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

Re: [PATCH v2] mmap.2: MAP_FIXED updated documentation

2017-12-05 Thread Michal Hocko
On Mon 04-12-17 23:42:00, John Hubbard wrote: > On 12/04/2017 11:05 PM, Michal Hocko wrote: > > On Mon 04-12-17 18:14:18, John Hubbard wrote: > >> On 12/04/2017 02:55 AM, Cyril Hrubis wrote: > >>> Hi! > >>> I know that we are not touching the rest of the existing description for > >>> MAP_FIXED

Re: [PATCH v2] mmap.2: MAP_FIXED updated documentation

2017-12-05 Thread Michal Hocko
On Mon 04-12-17 23:42:00, John Hubbard wrote: > On 12/04/2017 11:05 PM, Michal Hocko wrote: > > On Mon 04-12-17 18:14:18, John Hubbard wrote: > >> On 12/04/2017 02:55 AM, Cyril Hrubis wrote: > >>> Hi! > >>> I know that we are not touching the rest of the existing description for > >>> MAP_FIXED

Re: [PATCH v2] mmap.2: MAP_FIXED updated documentation

2017-12-04 Thread John Hubbard
On 12/04/2017 11:08 PM, Michal Hocko wrote: > On Mon 04-12-17 18:52:27, John Hubbard wrote: >> On 12/04/2017 03:31 AM, Mike Rapoport wrote: >>> On Sun, Dec 03, 2017 at 06:14:11PM -0800, john.hubb...@gmail.com wrote: From: John Hubbard >> [...] +.IP +Given

Re: [PATCH v2] mmap.2: MAP_FIXED updated documentation

2017-12-04 Thread John Hubbard
On 12/04/2017 11:08 PM, Michal Hocko wrote: > On Mon 04-12-17 18:52:27, John Hubbard wrote: >> On 12/04/2017 03:31 AM, Mike Rapoport wrote: >>> On Sun, Dec 03, 2017 at 06:14:11PM -0800, john.hubb...@gmail.com wrote: From: John Hubbard >> [...] +.IP +Given the above

Re: [PATCH v2] mmap.2: MAP_FIXED updated documentation

2017-12-04 Thread John Hubbard
On 12/04/2017 11:05 PM, Michal Hocko wrote: > On Mon 04-12-17 18:14:18, John Hubbard wrote: >> On 12/04/2017 02:55 AM, Cyril Hrubis wrote: >>> Hi! >>> I know that we are not touching the rest of the existing description for >>> MAP_FIXED however the second sentence in the manual page says that

Re: [PATCH v2] mmap.2: MAP_FIXED updated documentation

2017-12-04 Thread John Hubbard
On 12/04/2017 11:05 PM, Michal Hocko wrote: > On Mon 04-12-17 18:14:18, John Hubbard wrote: >> On 12/04/2017 02:55 AM, Cyril Hrubis wrote: >>> Hi! >>> I know that we are not touching the rest of the existing description for >>> MAP_FIXED however the second sentence in the manual page says that

Re: [PATCH v2] mmap.2: MAP_FIXED updated documentation

2017-12-04 Thread Michal Hocko
On Mon 04-12-17 18:52:27, John Hubbard wrote: > On 12/04/2017 03:31 AM, Mike Rapoport wrote: > > On Sun, Dec 03, 2017 at 06:14:11PM -0800, john.hubb...@gmail.com wrote: > >> From: John Hubbard > >> > [...] > >> +.IP > >> +Given the above limitations, one of the very few ways

Re: [PATCH v2] mmap.2: MAP_FIXED updated documentation

2017-12-04 Thread Michal Hocko
On Mon 04-12-17 18:52:27, John Hubbard wrote: > On 12/04/2017 03:31 AM, Mike Rapoport wrote: > > On Sun, Dec 03, 2017 at 06:14:11PM -0800, john.hubb...@gmail.com wrote: > >> From: John Hubbard > >> > [...] > >> +.IP > >> +Given the above limitations, one of the very few ways to use this option >

Re: [PATCH v2] mmap.2: MAP_FIXED updated documentation

2017-12-04 Thread Michal Hocko
On Mon 04-12-17 18:14:18, John Hubbard wrote: > On 12/04/2017 02:55 AM, Cyril Hrubis wrote: > > Hi! > > I know that we are not touching the rest of the existing description for > > MAP_FIXED however the second sentence in the manual page says that "addr > > must be a multiple of the page size."

Re: [PATCH v2] mmap.2: MAP_FIXED updated documentation

2017-12-04 Thread Michal Hocko
On Mon 04-12-17 18:14:18, John Hubbard wrote: > On 12/04/2017 02:55 AM, Cyril Hrubis wrote: > > Hi! > > I know that we are not touching the rest of the existing description for > > MAP_FIXED however the second sentence in the manual page says that "addr > > must be a multiple of the page size."

Re: [PATCH v2] mmap.2: MAP_FIXED updated documentation

2017-12-04 Thread John Hubbard
On 12/04/2017 03:31 AM, Mike Rapoport wrote: > On Sun, Dec 03, 2017 at 06:14:11PM -0800, john.hubb...@gmail.com wrote: >> From: John Hubbard >> [...] >> +.IP >> +Given the above limitations, one of the very few ways to use this option >> +safely is: mmap() a region, without

Re: [PATCH v2] mmap.2: MAP_FIXED updated documentation

2017-12-04 Thread John Hubbard
On 12/04/2017 03:31 AM, Mike Rapoport wrote: > On Sun, Dec 03, 2017 at 06:14:11PM -0800, john.hubb...@gmail.com wrote: >> From: John Hubbard >> [...] >> +.IP >> +Given the above limitations, one of the very few ways to use this option >> +safely is: mmap() a region, without specifying MAP_FIXED.

Re: [PATCH v2] mmap.2: MAP_FIXED updated documentation

2017-12-04 Thread John Hubbard
On 12/04/2017 02:55 AM, Cyril Hrubis wrote: > Hi! > I know that we are not touching the rest of the existing description for > MAP_FIXED however the second sentence in the manual page says that "addr > must be a multiple of the page size." Which however is misleading as > this is not enough on

Re: [PATCH v2] mmap.2: MAP_FIXED updated documentation

2017-12-04 Thread John Hubbard
On 12/04/2017 02:55 AM, Cyril Hrubis wrote: > Hi! > I know that we are not touching the rest of the existing description for > MAP_FIXED however the second sentence in the manual page says that "addr > must be a multiple of the page size." Which however is misleading as > this is not enough on

Re: [PATCH v2] mmap.2: MAP_FIXED updated documentation

2017-12-04 Thread Mike Rapoport
On Sun, Dec 03, 2017 at 06:14:11PM -0800, john.hubb...@gmail.com wrote: > From: John Hubbard > > Previously, MAP_FIXED was "discouraged", due to portability > issues with the fixed address. In fact, there are other, more > serious issues. Also, in some limited cases, this

Re: [PATCH v2] mmap.2: MAP_FIXED updated documentation

2017-12-04 Thread Mike Rapoport
On Sun, Dec 03, 2017 at 06:14:11PM -0800, john.hubb...@gmail.com wrote: > From: John Hubbard > > Previously, MAP_FIXED was "discouraged", due to portability > issues with the fixed address. In fact, there are other, more > serious issues. Also, in some limited cases, this option can > be used

Re: [PATCH v2] mmap.2: MAP_FIXED updated documentation

2017-12-04 Thread Cyril Hrubis
Hi! I know that we are not touching the rest of the existing description for MAP_FIXED however the second sentence in the manual page says that "addr must be a multiple of the page size." Which however is misleading as this is not enough on some architectures. Code in the wild seems to (mis)use

Re: [PATCH v2] mmap.2: MAP_FIXED updated documentation

2017-12-04 Thread Cyril Hrubis
Hi! I know that we are not touching the rest of the existing description for MAP_FIXED however the second sentence in the manual page says that "addr must be a multiple of the page size." Which however is misleading as this is not enough on some architectures. Code in the wild seems to (mis)use