From: Miklos Szeredi <miklos@szeredi.hu>
To: hugh@veritas.com
Cc: akpm@linux-foundation.org, mszeredi@suse.cz, pbadari@us.ibm.com,
linux-mm@kvack.org
Subject: Re: [PATCH 2/4] holepunch: fix shmem_truncate_range punch locking
Date: Thu, 29 Mar 2007 13:32:16 +0200 [thread overview]
Message-ID: <E1HWsrY-0000zQ-00@dorka.pomaz.szeredi.hu> (raw)
In-Reply-To: <Pine.LNX.4.64.0703281550300.11726@blonde.wat.veritas.com> (message from Hugh Dickins on Wed, 28 Mar 2007 15:51:25 +0100 (BST))
> Miklos Szeredi observes that during truncation of shmem page directories,
> info->lock is released to improve latency (after lowering i_size and
> next_index to exclude races); but this is quite wrong for holepunching,
> which receives no such protection from i_size or next_index, and is left
> vulnerable to races with shmem_unuse, shmem_getpage and shmem_writepage.
>
> Hold info->lock throughout when holepunching? No, any user could prevent
> rescheduling for far too long. Instead take info->lock just when needed:
> in shmem_free_swp when removing the swap entries, and whenever removing
> a directory page from the level above. But so long as we remove before
> scanning, we can safely skip taking the lock at the lower levels, except
> at misaligned start and end of the hole.
ACK, but I think this has become way too complex, and none of us will
understand it in a month or so :(
Miklos
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2007-03-29 11:32 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-28 14:50 [PATCH 1/4] holepunch: fix shmem_truncate_range punching too far Hugh Dickins
2007-03-28 14:51 ` [PATCH 2/4] holepunch: fix shmem_truncate_range punch locking Hugh Dickins
2007-03-29 11:32 ` Miklos Szeredi [this message]
2007-03-28 14:52 ` [PATCH 3/4] holepunch: fix disconnected pages after second truncate Hugh Dickins
2007-03-28 14:54 ` [PATCH 4/4] holepunch: fix mmap_sem i_mutex deadlock Hugh Dickins
2007-03-29 10:57 ` [PATCH 1/4] holepunch: fix shmem_truncate_range punching too far Miklos Szeredi
2007-03-29 11:56 ` Hugh Dickins
2007-03-29 12:11 ` Miklos Szeredi
2007-03-29 13:39 ` Hugh Dickins
2007-03-29 14:35 ` Miklos Szeredi
2007-03-29 22:48 ` Peter Chubb
2007-03-30 4:01 ` Hugh Dickins
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=E1HWsrY-0000zQ-00@dorka.pomaz.szeredi.hu \
--to=miklos@szeredi.hu \
--cc=akpm@linux-foundation.org \
--cc=hugh@veritas.com \
--cc=linux-mm@kvack.org \
--cc=mszeredi@suse.cz \
--cc=pbadari@us.ibm.com \
/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