Linux-XFS Archive mirror
 help / color / mirror / Atom feed
From: Zi Yan <ziy@nvidia.com>
To: Pankaj Raghav <kernel@pankajraghav.com>
Cc: Matthew Wilcox <willy@infradead.org>,
	linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	gost.dev@samsung.com, chandan.babu@oracle.com, hare@suse.de,
	mcgrof@kernel.org, djwong@kernel.org, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org, david@fromorbit.com,
	akpm@linux-foundation.org, Pankaj Raghav <p.raghav@samsung.com>
Subject: Re: [PATCH v3 07/11] mm: do not split a folio if it has minimum folio order requirement
Date: Tue, 26 Mar 2024 12:38:38 -0400	[thread overview]
Message-ID: <35B8EDE2-60FB-4376-98BC-DF79C43F1B68@nvidia.com> (raw)
In-Reply-To: <c0c777d9-8393-47f0-b5c3-1617c3a7b3ba@pankajraghav.com>

[-- Attachment #1: Type: text/plain, Size: 2109 bytes --]

On 26 Mar 2024, at 12:33, Pankaj Raghav wrote:

> On 26/03/2024 17:23, Zi Yan wrote:
>> On 26 Mar 2024, at 12:10, Pankaj Raghav (Samsung) wrote:
>>
>>> On Mon, Mar 25, 2024 at 07:06:04PM +0000, Matthew Wilcox wrote:
>>>> On Wed, Mar 13, 2024 at 06:02:49PM +0100, Pankaj Raghav (Samsung) wrote:
>>>>> From: Pankaj Raghav <p.raghav@samsung.com>
>>>>>
>>>>> As we don't have a way to split a folio to a any given lower folio
>>>>> order yet, avoid splitting the folio in split_huge_page_to_list() if it
>>>>> has a minimum folio order requirement.
>>>>
>>>> FYI, Zi Yan's patch to do that is now in Andrew's tree.
>>>> c010d47f107f609b9f4d6a103b6dfc53889049e9 in current linux-next (dated
>>>> Feb 26)
>>>
>>> Yes, I started playing with the patches but I am getting a race condition
>>> resulting in a null-ptr-deref for which I don't have a good answer for
>>> yet.
>>>
>>> @zi yan Did you encounter any issue like this when you were testing?
>>>
>>> I did the following change (just a prototype) instead of this patch:
>>>
>>> diff --git a/mm/huge_memory.c b/mm/huge_memory.c
>>> index 9859aa4f7553..63ee7b6ed03d 100644
>>> --- a/mm/huge_memory.c
>>> +++ b/mm/huge_memory.c
>>> @@ -3041,6 +3041,10 @@ int split_huge_page_to_list_to_order(struct page *page, struct list_head *list,
>>>  {
>>>         struct folio *folio = page_folio(page);
>>>         struct deferred_split *ds_queue = get_deferred_split_queue(folio);
>>> +       unsigned int mapping_min_order = mapping_min_folio_order(folio->mapping);
>>
>> I am not sure if this is right. Since folio can be anonymous and folio->mapping
>> does not point to struct address_space.
>>
>>> +
>>> +       if (!folio_test_anon(folio))
>
> Hmm, but I update the new_order only if it is not anonymous. Do you think it is still
> wrong?

For anonymous folio, folio->mapping has last bit set and point to a possible struct anon_vma. I do not know what ->flag will be or if it is accessible in that case.
See: https://elixir.bootlin.com/linux/latest/source/include/linux/page-flags.h#L608

--
Best Regards,
Yan, Zi

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 854 bytes --]

  reply	other threads:[~2024-03-26 16:38 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-13 17:02 [PATCH v3 00/11] enable bs > ps in XFS Pankaj Raghav (Samsung)
2024-03-13 17:02 ` [PATCH v3 01/11] mm: Support order-1 folios in the page cache Pankaj Raghav (Samsung)
2024-03-13 17:02 ` [PATCH v3 02/11] fs: Allow fine-grained control of folio sizes Pankaj Raghav (Samsung)
2024-03-25 18:29   ` Matthew Wilcox
2024-03-26  8:44     ` Pankaj Raghav (Samsung)
2024-03-13 17:02 ` [PATCH v3 03/11] filemap: allocate mapping_min_order folios in the page cache Pankaj Raghav (Samsung)
2024-03-15 13:21   ` Pankaj Raghav (Samsung)
2024-03-13 17:02 ` [PATCH v3 04/11] readahead: rework loop in page_cache_ra_unbounded() Pankaj Raghav (Samsung)
2024-03-25 18:41   ` Matthew Wilcox
2024-03-26  8:56     ` Pankaj Raghav (Samsung)
2024-03-26  9:39     ` Hannes Reinecke
2024-03-26  9:44       ` Pankaj Raghav
2024-03-26 10:00         ` Hannes Reinecke
2024-03-26 10:06           ` Pankaj Raghav
2024-03-26 10:55             ` Hannes Reinecke
2024-03-26 13:41               ` Pankaj Raghav (Samsung)
2024-03-26 15:11     ` Pankaj Raghav (Samsung)
2024-03-13 17:02 ` [PATCH v3 05/11] readahead: allocate folios with mapping_min_order in readahead Pankaj Raghav (Samsung)
2024-03-25 19:00   ` Matthew Wilcox
2024-03-26 13:08     ` Pankaj Raghav (Samsung)
2024-04-22 11:03     ` Pankaj Raghav (Samsung)
2024-03-13 17:02 ` [PATCH v3 06/11] readahead: round up file_ra_state->ra_pages to mapping_min_nrpages Pankaj Raghav (Samsung)
2024-03-13 17:02 ` [PATCH v3 07/11] mm: do not split a folio if it has minimum folio order requirement Pankaj Raghav (Samsung)
2024-03-25 19:06   ` Matthew Wilcox
2024-03-26 16:10     ` Pankaj Raghav (Samsung)
2024-03-26 16:23       ` Zi Yan
2024-03-26 16:33         ` Pankaj Raghav
2024-03-26 16:38           ` Zi Yan [this message]
2024-03-13 17:02 ` [PATCH v3 08/11] iomap: fix iomap_dio_zero() for fs bs > system page size Pankaj Raghav (Samsung)
2024-03-13 17:02 ` [PATCH v3 09/11] xfs: expose block size in stat Pankaj Raghav (Samsung)
2024-03-13 17:02 ` [PATCH v3 10/11] xfs: make the calculation generic in xfs_sb_validate_fsb_count() Pankaj Raghav (Samsung)
2024-03-25 19:15   ` Matthew Wilcox
2024-03-26  9:53     ` Pankaj Raghav (Samsung)
2024-03-13 17:02 ` [PATCH v3 11/11] xfs: enable block size larger than page size support Pankaj Raghav (Samsung)
2024-03-25 19:19 ` [PATCH v3 00/11] enable bs > ps in XFS Matthew Wilcox
2024-03-26  9:53   ` Hannes Reinecke
2024-03-26 15:06     ` Pankaj Raghav
2024-03-26 14:54   ` Pankaj Raghav (Samsung)

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=35B8EDE2-60FB-4376-98BC-DF79C43F1B68@nvidia.com \
    --to=ziy@nvidia.com \
    --cc=akpm@linux-foundation.org \
    --cc=chandan.babu@oracle.com \
    --cc=david@fromorbit.com \
    --cc=djwong@kernel.org \
    --cc=gost.dev@samsung.com \
    --cc=hare@suse.de \
    --cc=kernel@pankajraghav.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=mcgrof@kernel.org \
    --cc=p.raghav@samsung.com \
    --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 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 read-only IMAP folder(s) and NNTP newsgroup(s).