Re: [PATCH 1/4] mm: Introduce and use page_cache_empty

2020-08-06 Thread Kirill A. Shutemov
y; ? > +} > + > /* > * Bits in mapping->flags. > */ -- Kirill A. Shutemov ___ Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org To unsubscribe send an email to linux-nvdimm-le...@lists.01.org

Re: [PATCH v3 3/6] mm: introduce memfd_secret system call to create "secret" memory areas

2020-08-06 Thread Kirill A. Shutemov
it is mapped there as uncached. I'm not sure why flag for exclusive mode is needed. It has to be default. And if you want uncached on top of that set the flag. What am I missing? -- Kirill A. Shutemov ___ Linux-nvdimm mailing list -- linux-nvdimm@lists

Re: [PATCH v3 1/6] mm: add definition of PMD_PAGE_ORDER

2020-08-06 Thread Kirill A. Shutemov
t; +/* Number of base pages in a second level leaf page */ > +#define PMD_PAGE_ORDER (PMD_SHIFT - PAGE_SHIFT) > + > /* > * A page table page can be thought of an array like this: > pXd_t[PTRS_PER_PxD] > * -- Kirill A. Shutemov ___ Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org To unsubscribe send an email to linux-nvdimm-le...@lists.01.org

Re: [RFC PATCH v2 2/2] Implement sharing/unsharing of PMDs for FS/DAX

2019-06-11 Thread Kirill A. Shutemov
pages? This is just broken. > + > + pmd = pmd_offset(pud, addr); > + if (sz != PMD_SIZE && pmd_none(*pmd)) > + return NULL; > + /* hugepage or swap? */ > + if (pmd_huge(*pmd) || !pmd_present(*pmd)) > + return pmd; > + > + return NULL; > +} > + -- Kirill A. Shutemov ___ Linux-nvdimm mailing list Linux-nvdimm@lists.01.org https://lists.01.org/mailman/listinfo/linux-nvdimm

Re: [PATCH, RFC 2/2] Implement sharing/unsharing of PMDs for FS/DAX

2019-06-11 Thread Kirill A. Shutemov
nd you can map it with PMD page? I believe you don't have such guarantee. -- Kirill A. Shutemov ___ Linux-nvdimm mailing list Linux-nvdimm@lists.01.org https://lists.01.org/mailman/listinfo/linux-nvdimm

Re: [PATCH, RFC 0/2] Share PMDs for FS/DAX on x86

2019-05-14 Thread Kirill A. Shutemov
On Thu, May 09, 2019 at 09:05:31AM -0700, Larry Bassel wrote: > This patchset implements sharing of page table entries pointing > to 2MiB pages (PMDs) for FS/DAX on x86. -EPARSE. How do you share entries? Entries do not take any space, page tables that cointain these entries do. Have you

Re: [PATCH, RFC 2/2] Implement sharing/unsharing of PMDs for FS/DAX

2019-05-14 Thread Kirill A. Shutemov
On Thu, May 09, 2019 at 09:05:33AM -0700, Larry Bassel wrote: > This is based on (but somewhat different from) what hugetlbfs > does to share/unshare page tables. > > Signed-off-by: Larry Bassel > --- > include/linux/hugetlb.h | 4 ++ > mm/huge_memory.c| 32 ++ >

Re: [PATCH 2/2] mm/dax: Don't enable huge dax mapping by default

2019-03-19 Thread Kirill A. Shutemov
ges in that case? > > The problem with the transparent_hugepage/enabled interface is that it > conflates performing compaction work to produce THP-pages with the > ability to map huge pages at all. That's not [entirely] true. transparent_hugepage/defrag gates heavy-duty compaction. We

Re: [PATCH 2/2] mm/dax: Don't enable huge dax mapping by default

2019-03-06 Thread Kirill A. Shutemov
ocated out of /dev/dax/ or > /dev/pmem*. Do we have a reason not to use hugepages for mapping pages in > that case? Yes. Like when you don't want dax to compete for TLB with mission-critical application (which uses hugetlb for instance). -- Kirill A. Shutemov ___ Linux-nvdimm mailing list Linux-nvdimm@lists.01.org https://lists.01.org/mailman/listinfo/linux-nvdimm

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

2017-08-26 Thread Kirill A. Shutemov
mmap() can validate whether a flag > is supported on per architecture basis. Also the plan is to plumb the > flags passed to the syscall all the way down to the individual mmap > implementations. The ext4 and xfs ->mmap() operations will be able to > return -EOPNOTSUP based on runtime

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

2017-08-25 Thread Kirill A. Shutemov
On Fri, Aug 25, 2017 at 04:19:19PM +, Helge Deller wrote: > On 25.08.2017 18:16, Kirill A. Shutemov wrote: > > On Fri, Aug 25, 2017 at 09:02:36AM -0700, Christoph Hellwig wrote: > >> On Fri, Aug 25, 2017 at 06:58:03PM +0300, Kirill A. Shutemov wrote: > >&g

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

2017-08-25 Thread Kirill A. Shutemov
On Fri, Aug 25, 2017 at 09:02:36AM -0700, Christoph Hellwig wrote: > On Fri, Aug 25, 2017 at 06:58:03PM +0300, Kirill A. Shutemov wrote: > > Not all archs are ready for this: > > > > arch/parisc/include/uapi/asm/mman.h:#define MAP_TYPE0x03/* > &g

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

2017-08-25 Thread Kirill A. Shutemov
the anonymous and nommu cases. > > So if we pick e.g. 0x4 as the valid bit we don't even need to overload > the MAP_SHARED and MAP_PRIVATE meaning. Not all archs are ready for this: arch/parisc/include/uapi/asm/mman.h:#define MAP_TYPE0x03/* Mask for type of mapp

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

2017-08-16 Thread Kirill A. Shutemov
ercommit_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. -- Kirill A. Shutemov ___ Linux-nvdimm mailing list Linux-nvdimm@lists.01.org https://lists.01.org/mailman/listinfo/linux-nvdimm

Re: [PATCH v5 4/5] fs, xfs: introduce MAP_DIRECT for creating block-map-atomic file ranges

2017-08-16 Thread Kirill A. Shutemov
MAP_PRIVATE|MAP_DIRECT)) > + == (MAP_PRIVATE|MAP_DIRECT)) > + return -EINVAL; We've already checked for MAP_PRIVATE in this codepath. Simple (flags & MAP_DIRECT) would be enough. -- Kirill A. Shutemov

Re: [PATCH v4 3/3] fs, xfs: introduce MAP_DIRECT for creating block-map-sealed file ranges

2017-08-16 Thread Kirill A. Shutemov
DIRECT does not. This > allows the 'permission to mmap(MAP_DIRECT)' to be passed around with > an open file descriptor. Sounds like a good approach to me. -- Kirill A. Shutemov ___ Linux-nvdimm mailing list Linux-nvdimm@lists.01.org https://lists.01.org/mailman/listinfo/linux-nvdimm

Re: [PATCH v4 3/3] fs, xfs: introduce MAP_DIRECT for creating block-map-sealed file ranges

2017-08-15 Thread Kirill A. Shutemov
g at a file offset that > might require block-map updates. I think it should be SIGBUS. -- Kirill A. Shutemov ___ Linux-nvdimm mailing list Linux-nvdimm@lists.01.org https://lists.01.org/mailman/listinfo/linux-nvdimm

Re: [PATCH v5 1/5] mm: add vm_insert_mixed_mkwrite()

2017-07-25 Thread Kirill A. Shutemov
On Tue, Jul 25, 2017 at 02:50:37PM +0200, Jan Kara wrote: > On Tue 25-07-17 14:15:22, Christoph Hellwig wrote: > > On Tue, Jul 25, 2017 at 11:35:08AM +0200, Jan Kara wrote: > > > On Tue 25-07-17 10:01:58, Christoph Hellwig wrote: > > > > On Tue, Jul 25, 2017 at 01:14:

Re: [PATCH v5 1/5] mm: add vm_insert_mixed_mkwrite()

2017-07-24 Thread Kirill A. Shutemov
the same spot to write data or not. I think your assumptions works for ext4 and xfs. I wouldn't be that sure for btrfs or other filesystems with CoW support. -- Kirill A. Shutemov ___ Linux-nvdimm mailing list Linux-nvdimm@lists.01.org https://lists.01.org/mailman/listinfo/linux-nvdimm

Re: [PATCH 1/2] mm: improve readability of transparent_hugepage_enabled()

2017-06-12 Thread Kirill A. Shutemov
undation.org> > Cc: Ross Zwisler <ross.zwis...@linux.intel.com> > Cc: "Kirill A. Shutemov" <kirill.shute...@linux.intel.com> > Signed-off-by: Dan Williams <dan.j.willi...@intel.com> Looks good (unless it breaks build somewhere). Acked-by: Kirill A. Shu

Re: [PATCH 2/2] mm: always enable thp for dax mappings

2017-06-12 Thread Kirill A. Shutemov
GE_MM_H > #define _LINUX_HUGE_MM_H > > +#include > + It means now depends on . I don't think it's a good idea. -- Kirill A. Shutemov ___ Linux-nvdimm mailing list Linux-nvdimm@lists.01.org https://lists.01.org/mailman/listinfo/linux-nvdimm

Re: [PATCH 12/20] mm: Pass vm_fault structure into do_page_mkwrite()

2016-11-18 Thread Kirill A. Shutemov
om upper layers. > > Reviewed-by: Ross Zwisler <ross.zwis...@linux.intel.com> > Signed-off-by: Jan Kara <j...@suse.cz> Acked-by: Kirill A. Shutemov <kirill.shute...@linux.intel.com> -- Kirill A. Shutemov ___ Linux-nvdimm ma

Re: [PATCH 01/20] mm: Join struct fault_env and vm_fault

2016-11-18 Thread Kirill A. Shutemov
ll that is needed to use it for both purposes. > > Signed-off-by: Jan Kara <j...@suse.cz> Acked-by: Kirill A. Shutemov <kirill.shute...@linux.intel.com> -- Kirill A. Shutemov ___ Linux-nvdimm mailing list Linux-nvdimm@lists.01.org https://lists.01.org/mailman/listinfo/linux-nvdimm

Re: [PATCH 11/21] mm: Remove unnecessary vma->vm_ops check

2016-11-16 Thread Kirill A. Shutemov
On Wed, Nov 16, 2016 at 02:29:18PM +0100, Jan Kara wrote: > On Wed 16-11-16 01:28:19, Kirill A. Shutemov wrote: > > On Fri, Nov 04, 2016 at 05:25:07AM +0100, Jan Kara wrote: > > > We don't check whether vma->vm_ops is NULL in do_shared_fault() so > > > there'

Re: [PATCH 02/21] mm: Use vmf->address instead of of vmf->virtual_address

2016-11-16 Thread Kirill A. Shutemov
On Wed, Nov 16, 2016 at 12:05:05PM +0100, Jan Kara wrote: > On Wed 16-11-16 00:55:31, Kirill A. Shutemov wrote: > > On Fri, Nov 04, 2016 at 05:24:58AM +0100, Jan Kara wrote: > > > Every single user of vmf->virtual_address typed that entry to unsigned > > > long be

Re: [PATCH 01/21] mm: Join struct fault_env and vm_fault

2016-11-16 Thread Kirill A. Shutemov
On Wed, Nov 16, 2016 at 11:51:32AM +0100, Peter Zijlstra wrote: > On Wed, Nov 16, 2016 at 12:50:21AM +0300, Kirill A. Shutemov wrote: > > On Fri, Nov 04, 2016 at 05:24:57AM +0100, Jan Kara wrote: > > > Currently we have two different structures for passing fault information >

Re: [PATCH 17/21] mm: Change return values of finish_mkwrite_fault()

2016-11-15 Thread Kirill A. Shutemov
and we should probably clean that up. > > Signed-off-by: Jan Kara <j...@suse.cz> Sounds right. Acked-by: Kirill A. Shutemov <kirill.shute...@linux.intel.com> -- Kirill A. Shutemov ___ Linux-nvdimm mailing list Linux-nvdimm@lists.01.org https://lists.01.org/mailman/listinfo/linux-nvdimm

Re: [PATCH 15/21] mm: Move part of wp_page_reuse() into the single call site

2016-11-15 Thread Kirill A. Shutemov
locked page, sometimes unlocked etc. > > Reviewed-by: Ross Zwisler <ross.zwis...@linux.intel.com> > Signed-off-by: Jan Kara <j...@suse.cz> Acked-by: Kirill A. Shutemov <kirill.shute...@linux.intel.com> -- Kirill A. Shutemov ___

Re: [PATCH 13/21] mm: Pass vm_fault structure into do_page_mkwrite()

2016-11-15 Thread Kirill A. Shutemov
tructive: we loose rest of the flags here. It's probably okay in current state of the code, but may be should restore them before return from do_page_mkwrite()? -- Kirill A. Shutemov ___ Linux-nvdimm mailing list Linux-nvdimm@lists.01.org https://lists.01.org/mailman/listinfo/linux-nvdimm

Re: [PATCH 12/21] mm: Factor out common parts of write fault handling

2016-11-15 Thread Kirill A. Shutemov
gned-off-by: Jan Kara <j...@suse.cz> Acked-by: Kirill A. Shutemov <kirill.shute...@linux.intel.com> -- Kirill A. Shutemov ___ Linux-nvdimm mailing list Linux-nvdimm@lists.01.org https://lists.01.org/mailman/listinfo/linux-nvdimm

Re: [PATCH 10/21] mm: Move handling of COW faults into DAX code

2016-11-15 Thread Kirill A. Shutemov
to fs/dax.c. > > Signed-off-by: Jan Kara <j...@suse.cz> On core-mm bits: Acked-by: Kirill A. Shutemov <kirill.shute...@linux.intel.com> -- Kirill A. Shutemov ___ Linux-nvdimm mailing list Linux-nvdimm@lists.01.org https://lists.01.org/mailman/listinfo/linux-nvdimm

Re: [PATCH 09/21] mm: Factor out functionality to finish page faults

2016-11-15 Thread Kirill A. Shutemov
o avoid some boilerplate code. > > Reviewed-by: Ross Zwisler <ross.zwis...@linux.intel.com> > Signed-off-by: Jan Kara <j...@suse.cz> Acked-by: Kirill A. Shutemov <kirill.shute...@linux.intel.com> -- Kirill A. Shutemov ___ Linux-nv

Re: [PATCH 08/21] mm: Allow full handling of COW faults in ->fault handlers

2016-11-15 Thread Kirill A. Shutemov
emove knowledge about special DAX locking from the generic fault code. > > Reviewed-by: Ross Zwisler <ross.zwis...@linux.intel.com> > Signed-off-by: Jan Kara <j...@suse.cz> Acked-by: Kirill A. Shutemov <kirill.shute...@linux.intel.com> -- Kirill A. Shutemov ___

Re: [PATCH 07/21] mm: Add orig_pte field into vm_fault

2016-11-15 Thread Kirill A. Shutemov
cz> Acked-by: Kirill A. Shutemov <kirill.shute...@linux.intel.com> -- Kirill A. Shutemov ___ Linux-nvdimm mailing list Linux-nvdimm@lists.01.org https://lists.01.org/mailman/listinfo/linux-nvdimm

Re: [PATCH 06/21] mm: Use passed vm_fault structure for in wp_pfn_shared()

2016-11-15 Thread Kirill A. Shutemov
an Kara <j...@suse.cz> Acked-by: Kirill A. Shutemov <kirill.shute...@linux.intel.com> -- Kirill A. Shutemov ___ Linux-nvdimm mailing list Linux-nvdimm@lists.01.org https://lists.01.org/mailman/listinfo/linux-nvdimm

Re: [PATCH 05/21] mm: Trim __do_fault() arguments

2016-11-15 Thread Kirill A. Shutemov
t rid of new_page too? Otherwise makes sense: Acked-by: Kirill A. Shutemov <kirill.shute...@linux.intel.com> -- Kirill A. Shutemov ___ Linux-nvdimm mailing list Linux-nvdimm@lists.01.org https://lists.01.org/mailman/listinfo/linux-nvdimm

Re: [PATCH 04/21] mm: Use passed vm_fault structure in __do_fault()

2016-11-15 Thread Kirill A. Shutemov
<j...@suse.cz> Acked-by: Kirill A. Shutemov <kirill.shute...@linux.intel.com> -- Kirill A. Shutemov ___ Linux-nvdimm mailing list Linux-nvdimm@lists.01.org https://lists.01.org/mailman/listinfo/linux-nvdimm

Re: [PATCH 03/21] mm: Use pgoff in struct vm_fault instead of passing it separately

2016-11-15 Thread Kirill A. Shutemov
<j...@suse.cz> Okay, makes sense. Acked-by: Kirill A. Shutemov <kirill.shute...@linux.intel.com> -- Kirill A. Shutemov ___ Linux-nvdimm mailing list Linux-nvdimm@lists.01.org https://lists.01.org/mailman/listinfo/linux-nvdimm

Re: [PATCH 02/21] mm: Use vmf->address instead of of vmf->virtual_address

2016-11-15 Thread Kirill A. Shutemov
-236,7 +236,7 @@ static int > spufs_mem_mmap_fault(struct vm_area_struct *vma, struct vm_fault *vmf) > { > struct spu_context *ctx = vma->vm_file->private_data; > - unsigned long address = (unsigned long)vmf->virtual_address; > + unsigned long

Re: [PATCH 01/21] mm: Join struct fault_env and vm_fault

2016-11-15 Thread Kirill A. Shutemov
On Fri, Nov 04, 2016 at 05:24:57AM +0100, Jan Kara wrote: > Currently we have two different structures for passing fault information > around - struct vm_fault and struct fault_env. DAX will need more > information in struct vm_fault to handle its faults so the content of > that structure would

Re: [PATCH 01/21] mm: Join struct fault_env and vm_fault

2016-11-02 Thread Kirill A. Shutemov
ll that is needed to use it for both purposes. What about just reference fault_env from vm_fault? We don't always need vm_fault where we nee fault_env. It may save space on stack for some codepaths. -- Kirill A. Shutemov ___ Linux-nvdimm mailing list Linux-n

Re: [PATCH 0/21 v4] dax: Clear dirty bits after flushing caches

2016-11-02 Thread Kirill A. Shutemov
nd x/21 patches. Which should I look at? -- Kirill A. Shutemov ___ Linux-nvdimm mailing list Linux-nvdimm@lists.01.org https://lists.01.org/mailman/listinfo/linux-nvdimm

Re: [RFC PATCH 1/2] mm, mincore2(): retrieve dax and tlb-size attributes of an address range

2016-09-12 Thread Kirill A. Shutemov
> > [1]: https://lkml.org/lkml/2016/9/7/61 > > Cc: Arnd Bergmann <a...@arndb.de> > Cc: Andrea Arcangeli <aarca...@redhat.com> > Cc: Andrew Morton <a...@linux-foundation.org> > Cc: Dave Hansen <dave.han...@linux.intel.com> > Cc: Xiao Guangrong <

Re: [PATCH 1/2] shmem: fix tmpfs to handle the huge= option properly

2016-09-12 Thread Kirill A. Shutemov
e of SHMEM_SB(sb)->huge remains as > SHMEM_HUGE_NEVER. User will need to specify "huge=" option to > enable huge page mappings. > > Reported-by: Hillf Danton <hillf...@alibaba-inc.com> > Signed-off-by: Toshi Kani <toshi.k...@hpe.com> > Cc: Andrew

Re: [PATCH v4 RESEND 0/2] Align mmap address for DAX pmd mappings

2016-09-09 Thread Kirill A. Shutemov
On Fri, Sep 09, 2016 at 05:21:40PM +, Kani, Toshimitsu wrote: > On Fri, 2016-09-09 at 15:36 +0300, Kirill A. Shutemov wrote: > > On Thu, Sep 08, 2016 at 11:21:46PM +, Kani, Toshimitsu wrote: > > > > > > On Thu, 2016-09-08 at 07:48 -0600, Kani, Toshimitsu wro

Re: [PATCH v4 RESEND 0/2] Align mmap address for DAX pmd mappings

2016-09-08 Thread Kirill A. Shutemov
On Mon, Aug 29, 2016 at 10:00:43PM +, Kani, Toshimitsu wrote: > On Mon, 2016-08-29 at 15:31 -0600, Kani, Toshimitsu wrote: > > On Mon, 2016-08-29 at 23:48 +0300, Kirill A. Shutemov wrote: > > > > > > On Mon, Aug 29, 2016 at 01:11:19PM -0600, Toshi Kani wrote: >