linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Richard Weinberger <richard.weinberger@gmail.com>
To: Emil Lenngren <emil.lenngren@gmail.com>
Cc: linux-mtd <linux-mtd@lists.infradead.org>
Subject: Re: mtdswap + ubi results in deadlock
Date: Tue, 15 Oct 2019 20:59:47 +0200	[thread overview]
Message-ID: <CAFLxGvz8t-oyzkZE-9X=b+f10-no=E8mqhxmct9eJ2PK54bTfw@mail.gmail.com> (raw)
In-Reply-To: <CAO1O6seC1UFVrDM1FxP09uPrQhAUxp3pU=YUy09Vj98mpcU=Cw@mail.gmail.com>

Emil,

On Tue, Oct 15, 2019 at 7:00 PM Emil Lenngren <emil.lenngren@gmail.com> wrote:
>
> Hi. I'm trying to use mtdswap together with ubi increase memory.
> Normally mtdswap has its own wear leveling but I want ubi to do that
> job instead. So I removed all wear leveling and oob usage from mtdswap
> (or really it doesn't do wear leveling if the mtd device has no oob)
> and am now using it with a gluebi mtd partition on top of ubi. It
> works good but in some occasions it deadlocks because ubi internally
> uses kmalloc, which in case of low memory, waits for swap to complete.
> But swap won't complete until the data is written to flash.
>
> Do you have any idea how to mitigate this issue?

Well, if you use UBI for swap then no memory allocation within UBI is allowed
to trigger swapping. Otherwise the memory allocation goes into
recursion and locks
up. This is what happens in your case.

You can try to pinpoint these allocations and use GFP_NOFS there but I fear
that will case other problems.

-- 
Thanks,
//richard

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

  reply	other threads:[~2019-10-15 19:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-15 16:59 mtdswap + ubi results in deadlock Emil Lenngren
2019-10-15 18:59 ` Richard Weinberger [this message]
2019-10-15 20:10   ` Emil Lenngren
2019-10-15 20:17     ` Richard Weinberger

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='CAFLxGvz8t-oyzkZE-9X=b+f10-no=E8mqhxmct9eJ2PK54bTfw@mail.gmail.com' \
    --to=richard.weinberger@gmail.com \
    --cc=emil.lenngren@gmail.com \
    --cc=linux-mtd@lists.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 NNTP newsgroup(s).