Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1713111

Re: [PATCH v5 3/5] mm: introduce mmap3 for safely defining new mmap flags

From Dan Williams <dan.j.williams@intel.com>
Newsgroups linux.kernel
Subject Re: [PATCH v5 3/5] mm: introduce mmap3 for safely defining new mmap flags
Date 2017-08-16 18:40 +0200
Message-ID <uf9wm-VL-29@gated-at.bofh.it> (permalink)
References <uf1p7-4gv-3@gated-at.bofh.it> <uf1p8-4gv-37@gated-at.bofh.it> <uf4wG-6mG-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, Aug 16, 2017 at 4:15 AM, Kirill A. Shutemov
<kirill@shutemov.name> wrote:
> On Wed, Aug 16, 2017 at 12:44:22AM -0700, Dan Williams wrote:
>> diff --git a/include/linux/mman.h b/include/linux/mman.h
>> index c8367041fafd..0e1de42c836f 100644
>> --- a/include/linux/mman.h
>> +++ b/include/linux/mman.h
>> @@ -7,6 +7,40 @@
>>  #include <linux/atomic.h>
>>  #include <uapi/linux/mman.h>
>>
>> +#ifndef MAP_32BIT
>> +#define MAP_32BIT 0
>> +#endif
>> +#ifndef MAP_HUGE_2MB
>> +#define MAP_HUGE_2MB 0
>> +#endif
>> +#ifndef MAP_HUGE_1GB
>> +#define MAP_HUGE_1GB 0
>> +#endif
>> +
>> +/*
>> + * The historical set of flags that all mmap implementations implicitly
>> + * support when file_operations.mmap_supported_mask is zero.
>> + */
>> +#define LEGACY_MAP_SUPPORTED_MASK (MAP_SHARED \
>> +             | MAP_PRIVATE \
>> +             | MAP_FIXED \
>> +             | MAP_ANONYMOUS \
>> +             | MAP_UNINITIALIZED \
>> +             | MAP_GROWSDOWN \
>> +             | MAP_DENYWRITE \
>> +             | MAP_EXECUTABLE \
>> +             | MAP_LOCKED \
>> +             | MAP_NORESERVE \
>> +             | MAP_POPULATE \
>> +             | MAP_NONBLOCK \
>> +             | MAP_STACK \
>> +             | MAP_HUGETLB \
>> +             | MAP_32BIT \
>> +             | MAP_HUGE_2MB \
>> +             | MAP_HUGE_1GB)
>> +
>> +#define      MAP_SUPPORTED_MASK (LEGACY_MAP_SUPPORTED_MASK)
>> +
>>  extern int sysctl_overcommit_memory;
>>  extern int sysctl_overcommit_ratio;
>>  extern unsigned long sysctl_overcommit_kbytes;
>
> Since we looking into mmap(2) ABI, maybe we should consider re-defining
> MAP_DENYWRITE and MAP_EXECUTABLE as 0 in hope that we would be able to
> re-use these bits in the future? These flags are ignored now anyway.

Yes, we can make these -EOPNOTSUPP in the new syscall.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v5 0/5] MAP_DIRECT and block-map-atomic files Dan Williams <dan.j.williams@intel.com> - 2017-08-16 10:00 +0200
  [PATCH v5 2/5] fs, xfs: introduce S_IOMAP_SEALED Dan Williams <dan.j.williams@intel.com> - 2017-08-16 10:00 +0200
  [PATCH v5 3/5] mm: introduce mmap3 for safely defining new mmap  flags Dan Williams <dan.j.williams@intel.com> - 2017-08-16 10:00 +0200
    Re: [PATCH v5 3/5] mm: introduce mmap3 for safely defining new mmap  flags "Kirill A. Shutemov" <kirill@shutemov.name> - 2017-08-16 13:20 +0200
      Re: [PATCH v5 3/5] mm: introduce mmap3 for safely defining new mmap flags Dan Williams <dan.j.williams@intel.com> - 2017-08-16 18:40 +0200
        Re: [PATCH v5 3/5] mm: introduce mmap3 for safely defining new mmap  flags "Kirill A. Shutemov" <kirill@shutemov.name> - 2017-08-16 18:50 +0200
          Re: [PATCH v5 3/5] mm: introduce mmap3 for safely defining new mmap flags Dan Williams <dan.j.williams@intel.com> - 2017-08-16 19:00 +0200
  [PATCH v5 4/5] fs,  xfs: introduce MAP_DIRECT for creating block-map-atomic file ranges Dan Williams <dan.j.williams@intel.com> - 2017-08-16 10:00 +0200
    Re: [PATCH v5 4/5] fs, xfs: introduce MAP_DIRECT for creating  block-map-atomic file ranges "Kirill A. Shutemov" <kirill@shutemov.name> - 2017-08-16 13:20 +0200
      Re: [PATCH v5 4/5] fs, xfs: introduce MAP_DIRECT for creating  block-map-atomic file ranges Dan Williams <dan.j.williams@intel.com> - 2017-08-16 18:30 +0200
        Re: [PATCH v5 4/5] fs, xfs: introduce MAP_DIRECT for creating  block-map-atomic file ranges Dan Williams <dan.j.williams@intel.com> - 2017-08-16 18:40 +0200
    Re: [PATCH v5 4/5] fs, xfs: introduce MAP_DIRECT for creating  block-map-atomic file ranges Dan Williams <dan.j.williams@intel.com> - 2017-08-16 19:30 +0200
  Re: [PATCH v5 0/5] MAP_DIRECT and block-map-atomic files Dan Williams <dan.j.williams@intel.com> - 2017-08-17 01:50 +0200

csiph-web