From: Cesar Eduardo Barros <cesarb@cesarb.net>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: linux-kernel@vger.kernel.org,
Dan Magenheimer <dan.magenheimer@oracle.com>,
linux-mm@kvack.org
Subject: Re: frontswap: is frontswap_init called from swapoff safe?
Date: Mon, 16 Jul 2012 21:41:00 -0300 [thread overview]
Message-ID: <5004B49C.6010708@cesarb.net> (raw)
In-Reply-To: <20120607003720.GI9472@phenom.dumpdata.com>
Em 06-06-2012 21:37, Konrad Rzeszutek Wilk escreveu:
> On Tue, Jun 05, 2012 at 07:41:52AM -0300, Cesar Eduardo Barros wrote:
>> I was looking at the swapfile.c parts of the recently-merged
>> frontswap, and noticed that frontswap_init can be called from
>> swapoff when try_to_unuse fails.
>>
>> This looks odd to me. Whether it is safe or not depends on what
>> frontswap_ops.init does, but the comment for __frontswap_init
>> ("Called when a swap device is swapon'd") and the function name
>> itself seem to imply it should be called only for swapon, not when
>> relinking the swap_info after a failed swapoff.
>
> <nods>
>>
>> In particular, if frontswap_ops.init assumes the swap map is empty,
>> it would break, since as far as I know when try_to_unuse fails there
>> are still pages in the swap.
>
> Let me look at this - can't do it this week - but will get back to you
> shortly.
Did you look at it already? (Just pinging in case you forgot.)
>>
>> (By the way, the comment above enable_swap_info at sys_swapoff needs
>> to be updated to also explain why reading p->frontswap_map outside
>> the lock is safe at that point, like it does for p->prio and
>> p->swap_map.)
--
Cesar Eduardo Barros
cesarb@cesarb.net
cesar.barros@gmail.com
--
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>
prev parent reply other threads:[~2012-07-17 0:41 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-05 10:41 frontswap: is frontswap_init called from swapoff safe? Cesar Eduardo Barros
2012-06-07 0:37 ` Konrad Rzeszutek Wilk
2012-07-17 0:41 ` Cesar Eduardo Barros [this message]
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=5004B49C.6010708@cesarb.net \
--to=cesarb@cesarb.net \
--cc=dan.magenheimer@oracle.com \
--cc=konrad.wilk@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.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 NNTP newsgroup(s).