[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20140312200303.7abc49b0.akpm@linux-foundation.org>
Date: Wed, 12 Mar 2014 20:03:03 -0700
From: Andrew Morton <akpm@...ux-foundation.org>
To: Joonsoo Kim <iamjoonsoo.kim@....com>
Cc: Minchan Kim <minchan@...nel.org>, Nitin Gupta <ngupta@...are.org>,
linux-kernel@...r.kernel.org,
Sergey Senozhatsky <sergey.senozhatsky@...il.com>,
Jerome Marchand <jmarchan@...hat.com>
Subject: Re: [PATCH v3] zram: support REQ_DISCARD
On Thu, 13 Mar 2014 11:46:17 +0900 Joonsoo Kim <iamjoonsoo.kim@....com> wrote:
> + while (n >= PAGE_SIZE) {
> + /*
> + * discard request can be too large so that the zram can
> + * be stucked for a long time if we handle the request
> + * at once. So handle the request by PAGE_SIZE unit at a time.
> + */
> + write_lock(&zram->meta->tb_lock);
> + zram_free_page(zram, index);
> + write_unlock(&zram->meta->tb_lock);
> + index++;
> + n -= PAGE_SIZE;
> + }
Well, you could use something like
if (need_resched()) {
unlock()
schedule()
lock()
}
here, or free 100 pages at a time or something silly like that. I
guess we retain these as options if/when that lock turns out to be
contended.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists