linux-api.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Williams <dan.j.williams@intel.com>
To: "Kirill A. Shutemov" <kirill@shutemov.name>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Jan Kara <jack@suse.cz>, Arnd Bergmann <arnd@arndb.de>,
	"linux-nvdimm@lists.01.org" <linux-nvdimm@lists.01.org>,
	Linux API <linux-api@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	linux-xfs@vger.kernel.org, Linux MM <linux-mm@kvack.org>,
	Andy Lutomirski <luto@kernel.org>,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>
Subject: Re: [PATCH v5 3/5] mm: introduce mmap3 for safely defining new mmap flags
Date: Wed, 16 Aug 2017 09:35:11 -0700	[thread overview]
Message-ID: <CAPcyv4gB1JycB_1k6mKe-_OwjZv1a7vPV6Hh393-U_HQ15RWEw@mail.gmail.com> (raw)
In-Reply-To: <20170816111541.6c4ulnipt5cxgfsb@node.shutemov.name>

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.

  reply	other threads:[~2017-08-16 16:35 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-16  7:44 [PATCH v5 0/5] MAP_DIRECT and block-map-atomic files Dan Williams
     [not found] ` <150286944610.8837.9513410258028246174.stgit-p8uTFz9XbKj2zm6wflaqv1nYeNYlB/vhral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2017-08-16  7:44   ` [PATCH v5 1/5] vfs: add flags parameter to ->mmap() in 'struct file_operations' Dan Williams
2017-08-16  7:44   ` [PATCH v5 4/5] fs, xfs: introduce MAP_DIRECT for creating block-map-atomic file ranges Dan Williams
     [not found]     ` <150286946864.8837.17147962029964281564.stgit-p8uTFz9XbKj2zm6wflaqv1nYeNYlB/vhral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2017-08-16 11:12       ` Kirill A. Shutemov
2017-08-16 16:29         ` Dan Williams
2017-08-16 16:32           ` Dan Williams
2017-08-16 17:28       ` Dan Williams
2017-08-16  7:44 ` [PATCH v5 2/5] fs, xfs: introduce S_IOMAP_SEALED Dan Williams
2017-08-16  7:44 ` [PATCH v5 3/5] mm: introduce mmap3 for safely defining new mmap flags Dan Williams
2017-08-16 11:15   ` Kirill A. Shutemov
2017-08-16 16:35     ` Dan Williams [this message]
     [not found]       ` <CAPcyv4gB1JycB_1k6mKe-_OwjZv1a7vPV6Hh393-U_HQ15RWEw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-08-16 16:47         ` Kirill A. Shutemov
     [not found]           ` <20170816164717.xjbtbdjtwnhvzukg-sVvlyX1904swdBt8bTSxpkEMvNT87kid@public.gmane.org>
2017-08-16 16:52             ` Dan Williams
2017-08-16  7:44 ` [PATCH v5 5/5] fs, fcntl: add F_MAP_DIRECT Dan Williams
2017-08-16 23:42 ` [PATCH v5 0/5] MAP_DIRECT and block-map-atomic files Dan Williams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAPcyv4gB1JycB_1k6mKe-_OwjZv1a7vPV6Hh393-U_HQ15RWEw@mail.gmail.com \
    --to=dan.j.williams@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=arnd@arndb.de \
    --cc=jack@suse.cz \
    --cc=kirill@shutemov.name \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-nvdimm@lists.01.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=luto@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).