All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sumanth Korikkar <sumanthk@linux.ibm.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: linux-ext4@vger.kernel.org, gerald.schaefer@linux.ibm.com,
	gor@linux.ibm.com, agordeev@linux.ibm.com,
	linux-f2fs-devel@lists.sourceforge.net,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-mm@kvack.org, linux-nilfs@vger.kernel.org
Subject: Re: [PATCH 06/10] hugetlbfs: Convert remove_inode_hugepages() to use filemap_get_folios()
Date: Mon, 13 Jun 2022 08:56:22 +0200	[thread overview]
Message-ID: <YqbflvrB9oEZ1whX@localhost.localdomain> (raw)
In-Reply-To: <YqO08Dsq8ZcAcWDQ@casper.infradead.org>

On Fri, Jun 10, 2022 at 10:17:36PM +0100, Matthew Wilcox wrote:
> On Fri, Jun 10, 2022 at 05:52:05PM +0200, Sumanth Korikkar wrote:
> > To reproduce:
> > * clone libhugetlbfs:
> > * Execute, PATH=$PATH:"obj64/" LD_LIBRARY_PATH=../obj64/ alloc-instantiate-race shared
> 
> ... it's a lot harder to set up hugetlb than that ...
> 
> anyway, i figured it out without being able to run the reproducer.
> 
> Can you try this?
> 
> diff --git a/mm/filemap.c b/mm/filemap.c
> index a30587f2e598..8ef861297ffb 100644
> --- a/mm/filemap.c
> +++ b/mm/filemap.c
> @@ -2160,7 +2160,11 @@ unsigned filemap_get_folios(struct address_space *mapping, pgoff_t *start,
>  		if (xa_is_value(folio))
>  			continue;
>  		if (!folio_batch_add(fbatch, folio)) {
> -			*start = folio->index + folio_nr_pages(folio);
> +			unsigned long nr = folio_nr_pages(folio);
> +
> +			if (folio_test_hugetlb(folio))
> +				nr = 1;
> +			*start = folio->index + nr;
>  			goto out;
>  		}
>  	}

Yes, With the patch, The above tests works fine. 

--
Thanks,
Sumanth

WARNING: multiple messages have this Message-ID (diff)
From: Sumanth Korikkar <sumanthk@linux.ibm.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: linux-nilfs@vger.kernel.org, gor@linux.ibm.com,
	linux-kernel@vger.kernel.org,
	linux-f2fs-devel@lists.sourceforge.net, linux-mm@kvack.org,
	linux-fsdevel@vger.kernel.org, gerald.schaefer@linux.ibm.com,
	linux-ext4@vger.kernel.org, agordeev@linux.ibm.com
Subject: Re: [f2fs-dev] [PATCH 06/10] hugetlbfs: Convert remove_inode_hugepages() to use filemap_get_folios()
Date: Mon, 13 Jun 2022 08:56:22 +0200	[thread overview]
Message-ID: <YqbflvrB9oEZ1whX@localhost.localdomain> (raw)
In-Reply-To: <YqO08Dsq8ZcAcWDQ@casper.infradead.org>

On Fri, Jun 10, 2022 at 10:17:36PM +0100, Matthew Wilcox wrote:
> On Fri, Jun 10, 2022 at 05:52:05PM +0200, Sumanth Korikkar wrote:
> > To reproduce:
> > * clone libhugetlbfs:
> > * Execute, PATH=$PATH:"obj64/" LD_LIBRARY_PATH=../obj64/ alloc-instantiate-race shared
> 
> ... it's a lot harder to set up hugetlb than that ...
> 
> anyway, i figured it out without being able to run the reproducer.
> 
> Can you try this?
> 
> diff --git a/mm/filemap.c b/mm/filemap.c
> index a30587f2e598..8ef861297ffb 100644
> --- a/mm/filemap.c
> +++ b/mm/filemap.c
> @@ -2160,7 +2160,11 @@ unsigned filemap_get_folios(struct address_space *mapping, pgoff_t *start,
>  		if (xa_is_value(folio))
>  			continue;
>  		if (!folio_batch_add(fbatch, folio)) {
> -			*start = folio->index + folio_nr_pages(folio);
> +			unsigned long nr = folio_nr_pages(folio);
> +
> +			if (folio_test_hugetlb(folio))
> +				nr = 1;
> +			*start = folio->index + nr;
>  			goto out;
>  		}
>  	}

Yes, With the patch, The above tests works fine. 

--
Thanks,
Sumanth


_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

WARNING: multiple messages have this Message-ID (diff)
From: Sumanth Korikkar <sumanthk@linux.ibm.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: linux-nilfs@vger.kernel.org, gor@linux.ibm.com,
	linux-kernel@vger.kernel.org,
	linux-f2fs-devel@lists.sourceforge.net, linux-mm@kvack.org,
	linux-fsdevel@vger.kernel.org, gerald.schaefer@linux.ibm.com,
	linux-ext4@vger.kernel.org, agordeev@linux.ibm.com
Subject: Re: [PATCH 06/10] hugetlbfs: Convert remove_inode_hugepages() to use filemap_get_folios()
Date: Mon, 13 Jun 2022 08:56:22 +0200	[thread overview]
Message-ID: <YqbflvrB9oEZ1whX@localhost.localdomain> (raw)
In-Reply-To: <YqO08Dsq8ZcAcWDQ@casper.infradead.org>

On Fri, Jun 10, 2022 at 10:17:36PM +0100, Matthew Wilcox wrote:
> On Fri, Jun 10, 2022 at 05:52:05PM +0200, Sumanth Korikkar wrote:
> > To reproduce:
> > * clone libhugetlbfs:
> > * Execute, PATH=$PATH:"obj64/" LD_LIBRARY_PATH=../obj64/ alloc-instantiate-race shared
> 
> ... it's a lot harder to set up hugetlb than that ...
> 
> anyway, i figured it out without being able to run the reproducer.
> 
> Can you try this?
> 
> diff --git a/mm/filemap.c b/mm/filemap.c
> index a30587f2e598..8ef861297ffb 100644
> --- a/mm/filemap.c
> +++ b/mm/filemap.c
> @@ -2160,7 +2160,11 @@ unsigned filemap_get_folios(struct address_space *mapping, pgoff_t *start,
>  		if (xa_is_value(folio))
>  			continue;
>  		if (!folio_batch_add(fbatch, folio)) {
> -			*start = folio->index + folio_nr_pages(folio);
> +			unsigned long nr = folio_nr_pages(folio);
> +
> +			if (folio_test_hugetlb(folio))
> +				nr = 1;
> +			*start = folio->index + nr;
>  			goto out;
>  		}
>  	}

Yes, With the patch, The above tests works fine. 

--
Thanks,
Sumanth

  parent reply	other threads:[~2022-06-13  6:57 UTC|newest]

Thread overview: 93+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-05 19:38 [PATCH 00/10] Convert to filemap_get_folios() Matthew Wilcox (Oracle)
2022-06-05 19:38 ` Matthew Wilcox (Oracle)
2022-06-05 19:38 ` [f2fs-dev] " Matthew Wilcox (Oracle)
2022-06-05 19:38 ` [PATCH 01/10] filemap: Add filemap_get_folios() Matthew Wilcox (Oracle)
2022-06-05 19:38   ` [f2fs-dev] " Matthew Wilcox (Oracle)
2022-06-08  8:00   ` Christoph Hellwig
2022-06-08  8:00     ` Christoph Hellwig
2022-06-08  8:00     ` [f2fs-dev] " Christoph Hellwig
2022-06-05 19:38 ` [PATCH 02/10] buffer: Convert clean_bdev_aliases() to use filemap_get_folios() Matthew Wilcox (Oracle)
2022-06-05 19:38   ` [f2fs-dev] " Matthew Wilcox (Oracle)
2022-06-08  8:01   ` Christoph Hellwig
2022-06-08  8:01     ` Christoph Hellwig
2022-06-08  8:01     ` [f2fs-dev] " Christoph Hellwig
2022-06-05 19:38 ` [PATCH 03/10] ext4: Convert mpage_release_unused_pages() " Matthew Wilcox (Oracle)
2022-06-05 19:38   ` Matthew Wilcox (Oracle)
2022-06-05 19:38   ` [f2fs-dev] " Matthew Wilcox (Oracle)
2022-06-08  8:02   ` Christoph Hellwig
2022-06-08  8:02     ` Christoph Hellwig
2022-06-08  8:02     ` [f2fs-dev] " Christoph Hellwig
2022-06-08 16:02     ` Matthew Wilcox
2022-06-08 16:02       ` Matthew Wilcox
2022-06-08 16:02       ` [f2fs-dev] " Matthew Wilcox
2022-06-09  3:55       ` Christoph Hellwig
2022-06-09  3:55         ` Christoph Hellwig
2022-06-09  3:55         ` [f2fs-dev] " Christoph Hellwig
2022-06-05 19:38 ` [PATCH 04/10] ext4: Convert mpage_map_and_submit_buffers() " Matthew Wilcox (Oracle)
2022-06-05 19:38   ` [f2fs-dev] " Matthew Wilcox (Oracle)
2022-06-08  8:03   ` Christoph Hellwig
2022-06-08  8:03     ` Christoph Hellwig
2022-06-08  8:03     ` [f2fs-dev] " Christoph Hellwig
2022-06-05 19:38 ` [f2fs-dev] [PATCH 05/10] f2fs: Convert f2fs_invalidate_compress_pages() " Matthew Wilcox (Oracle)
2022-06-05 19:38   ` Matthew Wilcox (Oracle)
2022-06-05 19:38   ` Matthew Wilcox (Oracle)
2022-06-08  8:03   ` Christoph Hellwig
2022-06-08  8:03     ` Christoph Hellwig
2022-06-08  8:03     ` [f2fs-dev] " Christoph Hellwig
2022-06-15  8:14   ` Chao Yu
2022-06-15  8:14     ` Chao Yu
2022-06-05 19:38 ` [PATCH 06/10] hugetlbfs: Convert remove_inode_hugepages() " Matthew Wilcox (Oracle)
2022-06-05 19:38   ` [f2fs-dev] " Matthew Wilcox (Oracle)
2022-06-08  8:04   ` Christoph Hellwig
2022-06-08  8:04     ` Christoph Hellwig
2022-06-08  8:04     ` [f2fs-dev] " Christoph Hellwig
2022-06-10 15:52   ` Sumanth Korikkar
2022-06-10 15:52     ` Sumanth Korikkar
2022-06-10 15:52     ` [f2fs-dev] " Sumanth Korikkar
2022-06-10 18:35     ` Gerald Schaefer
2022-06-10 18:35       ` Gerald Schaefer
2022-06-10 18:35       ` [f2fs-dev] " Gerald Schaefer
2022-06-10 21:17     ` Matthew Wilcox
2022-06-10 21:17       ` [f2fs-dev] " Matthew Wilcox
2022-06-10 21:56       ` Mike Kravetz
2022-06-10 21:56         ` Mike Kravetz
2022-06-10 21:56         ` [f2fs-dev] " Mike Kravetz
2022-06-13  6:56       ` Sumanth Korikkar [this message]
2022-06-13  6:56         ` Sumanth Korikkar
2022-06-13  6:56         ` [f2fs-dev] " Sumanth Korikkar
2022-06-05 19:38 ` [PATCH 07/10] nilfs2: Convert nilfs_copy_back_pages() " Matthew Wilcox (Oracle)
2022-06-05 19:38   ` [f2fs-dev] " Matthew Wilcox (Oracle)
2022-06-07 16:10   ` Ryusuke Konishi
2022-06-07 16:10     ` [f2fs-dev] " Ryusuke Konishi
2022-06-08  8:04   ` Christoph Hellwig
2022-06-08  8:04     ` Christoph Hellwig
2022-06-08  8:04     ` [f2fs-dev] " Christoph Hellwig
2022-06-05 19:38 ` [f2fs-dev] [PATCH 08/10] vmscan: Add check_move_unevictable_folios() Matthew Wilcox (Oracle)
2022-06-05 19:38   ` Matthew Wilcox (Oracle)
2022-06-05 19:38   ` Matthew Wilcox (Oracle)
2022-06-08  8:07   ` Christoph Hellwig
2022-06-08  8:07     ` Christoph Hellwig
2022-06-08  8:07     ` [f2fs-dev] " Christoph Hellwig
2022-06-08 16:32     ` Matthew Wilcox
2022-06-08 16:32       ` Matthew Wilcox
2022-06-08 16:32       ` [f2fs-dev] " Matthew Wilcox
2022-06-09  3:56       ` Christoph Hellwig
2022-06-09  3:56         ` Christoph Hellwig
2022-06-09  3:56         ` [f2fs-dev] " Christoph Hellwig
2022-06-08 15:33   ` [vmscan] bc9eb0d5ef: BUG:KASAN:stack-out-of-bounds_in_check_move_unevictable_pages kernel test robot
2022-06-08 15:33     ` kernel test robot
2022-06-05 19:38 ` [PATCH 09/10] shmem: Convert shmem_unlock_mapping() to use filemap_get_folios() Matthew Wilcox (Oracle)
2022-06-05 19:38   ` Matthew Wilcox (Oracle)
2022-06-05 19:38   ` [f2fs-dev] " Matthew Wilcox (Oracle)
2022-06-08  8:08   ` Christoph Hellwig
2022-06-08  8:08     ` Christoph Hellwig
2022-06-08  8:08     ` [f2fs-dev] " Christoph Hellwig
2022-06-05 19:38 ` [PATCH 10/10] filemap: Remove find_get_pages_range() and associated functions Matthew Wilcox (Oracle)
2022-06-05 19:38   ` Matthew Wilcox (Oracle)
2022-06-05 19:38   ` [f2fs-dev] " Matthew Wilcox (Oracle)
2022-06-08  8:08   ` Christoph Hellwig
2022-06-08  8:08     ` Christoph Hellwig
2022-06-08  8:08     ` [f2fs-dev] " Christoph Hellwig
2022-06-07 11:37 ` [PATCH 00/10] Convert to filemap_get_folios() Christian Brauner
2022-06-07 11:37   ` Christian Brauner
2022-06-07 11:37   ` [f2fs-dev] " Christian Brauner

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=YqbflvrB9oEZ1whX@localhost.localdomain \
    --to=sumanthk@linux.ibm.com \
    --cc=agordeev@linux.ibm.com \
    --cc=gerald.schaefer@linux.ibm.com \
    --cc=gor@linux.ibm.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-nilfs@vger.kernel.org \
    --cc=willy@infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.