All of lore.kernel.org
 help / color / mirror / Atom feed
From: Russell Knize <rknize@motorola.com>
To: Minchan Kim <minchan@kernel.org>
Cc: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>,
	Junil Lee <junil0814.lee@lge.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Nitin Gupta <ngupta@vflare.org>,
	linux-mm@kvack.org,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] zsmalloc: fix migrate_zspage-zs_free race condition
Date: Wed, 20 Jan 2016 09:21:11 -0600	[thread overview]
Message-ID: <CAGfvh62kn1px+NmV3vJ_-KtJNP7LH48QTiJ6vYrg3AC4jEZPMA@mail.gmail.com> (raw)
In-Reply-To: <20160120070019.GC12293@bbox>

Yes, I saw your v5 and have already started testing it.  I suspect it
will be stable, as the key for us was to set that bit before the
store.  We were only seeing it on ARM32, but those platforms tend
perform compaction far more often due to the memory pressure.  We
don't see it at all anymore.

Honestly, at first I didn't think setting the bit would help that much
as I assumed it was the barrier in the clear_bit_unlock() that
mattered.  Then I saw the same sort of race happening in the page
migration stuff I've been working on.  I had done the same type of
"optimization" there and in fact did not call unpin_tag() at all after
updating the object handles with the bit dropped.

Russ

On Wed, Jan 20, 2016 at 1:00 AM, Minchan Kim <minchan@kernel.org> wrote:
> Hello Russ,
>
> On Tue, Jan 19, 2016 at 09:47:12AM -0600, Russell Knize wrote:
>>    Just wanted to ack this, as we have been seeing the same problem (weird
>>    race conditions during compaction) and fixed it in the same way a few
>>    weeks ago (resetting the pin bit before recording the obj).
>>    Russ
>
> First of all, thanks for your comment.
>
> The patch you tested have a problem although it's really subtle(ie,
> it doesn't do store tearing when I disassemble ARM{32|64}) but it
> could have a problem potentially for other architecutres or future ARM.
> For right fix, I sent v5 - https://lkml.org/lkml/2016/1/18/263.
> If you can prove it fixes your problem, please Tested-by to the thread.
> It's really valuable to do testing for stable material.
>
> Thanks!

WARNING: multiple messages have this Message-ID (diff)
From: Russell Knize <rknize@motorola.com>
To: Minchan Kim <minchan@kernel.org>
Cc: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>,
	Junil Lee <junil0814.lee@lge.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Nitin Gupta <ngupta@vflare.org>,
	linux-mm@kvack.org,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] zsmalloc: fix migrate_zspage-zs_free race condition
Date: Wed, 20 Jan 2016 09:21:11 -0600	[thread overview]
Message-ID: <CAGfvh62kn1px+NmV3vJ_-KtJNP7LH48QTiJ6vYrg3AC4jEZPMA@mail.gmail.com> (raw)
In-Reply-To: <20160120070019.GC12293@bbox>

Yes, I saw your v5 and have already started testing it.  I suspect it
will be stable, as the key for us was to set that bit before the
store.  We were only seeing it on ARM32, but those platforms tend
perform compaction far more often due to the memory pressure.  We
don't see it at all anymore.

Honestly, at first I didn't think setting the bit would help that much
as I assumed it was the barrier in the clear_bit_unlock() that
mattered.  Then I saw the same sort of race happening in the page
migration stuff I've been working on.  I had done the same type of
"optimization" there and in fact did not call unpin_tag() at all after
updating the object handles with the bit dropped.

Russ

On Wed, Jan 20, 2016 at 1:00 AM, Minchan Kim <minchan@kernel.org> wrote:
> Hello Russ,
>
> On Tue, Jan 19, 2016 at 09:47:12AM -0600, Russell Knize wrote:
>>    Just wanted to ack this, as we have been seeing the same problem (weird
>>    race conditions during compaction) and fixed it in the same way a few
>>    weeks ago (resetting the pin bit before recording the obj).
>>    Russ
>
> First of all, thanks for your comment.
>
> The patch you tested have a problem although it's really subtle(ie,
> it doesn't do store tearing when I disassemble ARM{32|64}) but it
> could have a problem potentially for other architecutres or future ARM.
> For right fix, I sent v5 - https://lkml.org/lkml/2016/1/18/263.
> If you can prove it fixes your problem, please Tested-by to the thread.
> It's really valuable to do testing for stable material.
>
> Thanks!

--
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>

  reply	other threads:[~2016-01-20 15:21 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-15  0:36 [PATCH] zsmalloc: fix migrate_zspage-zs_free race condition Junil Lee
2016-01-15  0:36 ` Junil Lee
2016-01-15  2:35 ` Minchan Kim
2016-01-15  2:35   ` Minchan Kim
2016-01-15  3:27   ` Sergey Senozhatsky
2016-01-15  3:27     ` Sergey Senozhatsky
2016-01-15  3:30     ` Sergey Senozhatsky
2016-01-15  3:30       ` Sergey Senozhatsky
2016-01-15  4:49     ` Minchan Kim
2016-01-15  4:49       ` Minchan Kim
2016-01-15  5:07       ` Sergey Senozhatsky
2016-01-15  5:07         ` Sergey Senozhatsky
2016-01-19 15:47         ` Russell Knize
2016-01-20  7:00           ` Minchan Kim
2016-01-20  7:00             ` Minchan Kim
2016-01-20 15:21             ` Russell Knize [this message]
2016-01-20 15:21               ` Russell Knize
2016-01-15  5:05   ` Minchan Kim
2016-01-15  5:05     ` Minchan Kim

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=CAGfvh62kn1px+NmV3vJ_-KtJNP7LH48QTiJ6vYrg3AC4jEZPMA@mail.gmail.com \
    --to=rknize@motorola.com \
    --cc=akpm@linux-foundation.org \
    --cc=junil0814.lee@lge.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=minchan@kernel.org \
    --cc=ngupta@vflare.org \
    --cc=sergey.senozhatsky.work@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.