All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sidhartha Kumar <sidhartha.kumar@oracle.com>
To: Gerald Schaefer <gerald.schaefer@linux.ibm.com>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	akpm@linux-foundation.org, songmuchun@bytedance.com,
	mike.kravetz@oracle.com, willy@infradead.org,
	jhubbard@nvidia.com, linux-s390@vger.kernel.org
Subject: Re: [PATCH 8/9] mm/hugetlb: convert hugetlb_wp() to take in a folio
Date: Tue, 24 Jan 2023 10:38:35 -0800	[thread overview]
Message-ID: <ed11ad59-e2cc-a839-86aa-e6c4df23fee9@oracle.com> (raw)
In-Reply-To: <20230124162346.404985e8@thinkpad>

On 1/24/23 7:23 AM, Gerald Schaefer wrote:
> On Thu, 19 Jan 2023 13:14:45 -0800
> Sidhartha Kumar <sidhartha.kumar@oracle.com> wrote:
> 
> [...]
>>   	page = pte_page(entry);
>> -	if (page != pagecache_page)
>> +	if (page_folio(page) != pagecache_folio)
>>   		if (!trylock_page(page)) {
>>   			need_wait_lock = 1;
>>   			goto out_ptl;
>>   		}
>>   
>> -	get_page(page);
>> +	folio_get(pagecache_folio);
>>   
> 
> We get a kernel crash on s390 in mprotect testcase from libhugetlbfs
> testsuite, starting with next-20230120, bisected to this commit.
> 
> We get here with pagecache_folio == NULL, and crash in folio_get().
> It doesn´t seem right to replace the get_page() with folio_get()
> here, the matching put_page() at out_put_page: also wasn't changed
> correspondingly. Also, pagecache_folio == NULL seems to be a valid
> case here, on all architectures.
> 
> Reverting this folio_get() to get_page() fixes the crash. Not sure
> though if I missed something. I think you only want to replace
> pagecache_page with pagecache_folio, like in the rest of the commit,
> and not page -> pagecache_folio for this get_page().
Ya that get_page(page) line should have stayed how it was before as 
pagecache_folio is replacing instances of pagecache_page. Thanks for 
catching this, I'll fix this change in a v2 of this patch series.

Thanks,
Sidhartha Kumar


  reply	other threads:[~2023-01-24 19:11 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-19 21:14 [PATCH 0/9] convert hugetlb fault functions to folios Sidhartha Kumar
2023-01-19 21:14 ` [PATCH 1/9] mm/hugetlb: convert hugetlb_install_page " Sidhartha Kumar
2023-01-20 23:21   ` Mike Kravetz
2023-01-19 21:14 ` [PATCH 2/9] mm/hugetlb: convert hugetlbfs_pagecache_present() " Sidhartha Kumar
2023-01-20  5:43   ` Matthew Wilcox
2023-01-20 23:40     ` Mike Kravetz
2023-01-19 21:14 ` [PATCH 3/9] mm/hugetlb: convert putback_active_hugepage to take in a folio Sidhartha Kumar
2023-01-20  5:48   ` Matthew Wilcox
2023-01-20 23:47   ` Mike Kravetz
2023-01-19 21:14 ` [PATCH 4/9] mm/rmap: change hugepage_add_new_anon_rmap " Sidhartha Kumar
2023-01-20  6:00   ` Matthew Wilcox
2023-01-20 20:45     ` Sidhartha Kumar
2023-01-20 21:17       ` Matthew Wilcox
2023-01-20 22:05         ` Sidhartha Kumar
2023-01-19 21:14 ` [PATCH 5/9] mm/hugetlb: convert alloc_huge_page to alloc_hugetlb_folio Sidhartha Kumar
2023-01-19 21:14 ` [PATCH 6/9] mm/hugetlb: convert restore_reserve_on_error to take in a folio Sidhartha Kumar
2023-01-19 21:14 ` [PATCH 7/9] mm/hugetlb: convert hugetlb_add_to_page_cache " Sidhartha Kumar
2023-01-19 21:14 ` [PATCH 8/9] mm/hugetlb: convert hugetlb_wp() " Sidhartha Kumar
2023-01-24 15:23   ` Gerald Schaefer
2023-01-24 18:38     ` Sidhartha Kumar [this message]
2023-01-19 21:14 ` [PATCH 9/9] Documentation/mm: update hugetlbfs documentation to mention alloc_hugetlb_folio Sidhartha Kumar

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=ed11ad59-e2cc-a839-86aa-e6c4df23fee9@oracle.com \
    --to=sidhartha.kumar@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=gerald.schaefer@linux.ibm.com \
    --cc=jhubbard@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=mike.kravetz@oracle.com \
    --cc=songmuchun@bytedance.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 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.