linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Rik van Riel <riel@surriel.com>
To: Mike Kravetz <mike.kravetz@oracle.com>
Cc: linux-kernel@vger.kernel.org, kernel-team@meta.com,
	linux-mm@kvack.org,  akpm@linux-foundation.org,
	muchun.song@linux.dev, leit@meta.com,  willy@infradead.org
Subject: Re: [PATCH 3/3] hugetlbfs: replace hugetlb_vma_lock with invalidate_lock
Date: Thu, 05 Oct 2023 23:28:58 -0400	[thread overview]
Message-ID: <d31f976cd37567b88b359749ee31fbf42568dd6d.camel@surriel.com> (raw)
In-Reply-To: <20231006001912.GB86415@monkey>

On Thu, 2023-10-05 at 17:19 -0700, Mike Kravetz wrote:
> 
> I have not gone through the patch, but it does produce the following:
> 
> [   49.783584] =====================================
> [   49.784570] WARNING: bad unlock balance detected!
> [   49.785589] 6.6.0-rc3-next-20230925+ #35 Not tainted
> [   49.786644] -------------------------------------
> [   49.787768] hfill2/938 is trying to release lock
> (mapping.invalidate_lock) at:
> [   49.789387] [<ffffffff815212e5>]
> remove_inode_hugepages+0x405/0x4b0
> [   49.790723] but there are no more locks to release!
> [   49.791808] 
> [   49.791808] other info that might help us debug this:
> [   49.793274] 4 locks held by hfill2/938:
> [   49.794190]  #0: ffff8881ff3213e8 (sb_writers#11){.+.+}-{0:0}, at:
> do_syscall_64+0x37/0x90
> [   49.796165]  #1: ffff888181c99640 (&sb->s_type-
> >i_mutex_key#16){+.+.}-{3:3}, at: do_truncate+0x6f/0xd0
> [   49.798188]  #2: ffff888301592f98
> (&hugetlb_fault_mutex_table[i]){+.+.}-{3:3}, at:
> remove_inode_hugepages+0x144/0x4b0
> [   49.800494]  #3: ffff888181c998b0
> (&hugetlbfs_i_mmap_rwsem_key){++++}-{3:3}, at:
> remove_inode_hugepages+0x239/0x4b0

Well that's a fun one. The remove_inode_hugepages function
does not take the mapping.invalidate_lock, but it calls
hugetlb_unmap_file_folio which does.

The vma_interval_tree_foreach loop has a stray
hugetlb_vma_unlock_write() left, which I should have
removed when lifting the lock outside of the loop.

Nice catch!

-- 
All Rights Reversed.


  reply	other threads:[~2023-10-06  3:29 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-04  3:25 [PATCH v6 0/3] hugetlbfs: close race between MADV_DONTNEED and page fault riel
2023-10-04  3:25 ` [PATCH 1/3] hugetlbfs: extend hugetlb_vma_lock to private VMAs riel
2023-10-04  3:25 ` [PATCH 2/3] hugetlbfs: close race between MADV_DONTNEED and page fault riel
2023-10-05  3:19   ` Mike Kravetz
2023-10-05 13:23     ` Rik van Riel
2023-10-05 22:59       ` Mike Kravetz
2023-10-04  3:25 ` [PATCH 3/3] hugetlbfs: replace hugetlb_vma_lock with invalidate_lock riel
2023-10-06  0:19   ` Mike Kravetz
2023-10-06  3:28     ` Rik van Riel [this message]
  -- strict thread matches above, loose matches on Subject: below --
2023-10-01  0:55 [PATCH v5 0/3] hugetlbfs: close race between MADV_DONTNEED and page fault riel
2023-10-01  0:55 ` [PATCH 3/3] hugetlbfs: replace hugetlb_vma_lock with invalidate_lock riel
2023-10-02  5:22   ` Mike Kravetz
2023-09-26  3:10 [PATCH v4 0/3] hugetlbfs: close race between MADV_DONTNEED and page fault riel
2023-09-26  3:10 ` [PATCH 3/3] hugetlbfs: replace hugetlb_vma_lock with invalidate_lock riel
2023-09-25 20:28 [PATCH v3 0/3] hugetlbfs: close race between MADV_DONTNEED and page fault riel
2023-09-25 20:28 ` [PATCH 3/3] hugetlbfs: replace hugetlb_vma_lock with invalidate_lock riel
2023-09-22 19:02 [PATCH v2 0/3] hugetlbfs: close race between MADV_DONTNEED and page fault riel
2023-09-22 19:02 ` [PATCH 3/3] hugetlbfs: replace hugetlb_vma_lock with invalidate_lock riel
2023-09-24  6:44   ` kernel test robot
2023-09-25  2:04   ` kernel test robot
2023-09-25 19:22     ` Rik van Riel
2023-09-25 20:06       ` Mike Kravetz
2023-09-25 20:11         ` Rik van Riel

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=d31f976cd37567b88b359749ee31fbf42568dd6d.camel@surriel.com \
    --to=riel@surriel.com \
    --cc=akpm@linux-foundation.org \
    --cc=kernel-team@meta.com \
    --cc=leit@meta.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mike.kravetz@oracle.com \
    --cc=muchun.song@linux.dev \
    --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