All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
To: Vlastimil Babka <vbabka@suse.cz>
Cc: Minchan Kim <minchan@kernel.org>,
	Junil Lee <junil0814.lee@lge.com>,
	ngupta@vflare.org, sergey.senozhatsky.work@gmail.com,
	akpm@linux-foundation.org, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org, sergey.senozhatsky@gmail.com
Subject: Re: [PATCH v2] zsmalloc: fix migrate_zspage-zs_free race condition
Date: Sat, 16 Jan 2016 13:09:13 +0900	[thread overview]
Message-ID: <20160116040913.GA566@swordfish> (raw)
In-Reply-To: <56991514.9000609@suse.cz>

On (01/15/16 16:49), Vlastimil Babka wrote:
[..]
> 
> Could you please also help making the changelog more clear?
> 
> >
> >>+		free_obj |= BIT(HANDLE_PIN_BIT);
> >>  		record_obj(handle, free_obj);
> 
> I think record_obj() should use WRITE_ONCE() or something like that.
> Otherwise the compiler is IMHO allowed to reorder this, i.e. first to assign
> free_obj to handle, and then add the PIN bit there.

good note.

... or do both things in record_obj() (per Minchan)

	record_obj(handle, obj)
	{
	        *(unsigned long)handle = obj & ~(1<<HANDLE_PIN_BIT);
	}

	-ss

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

WARNING: multiple messages have this Message-ID (diff)
From: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
To: Vlastimil Babka <vbabka@suse.cz>
Cc: Minchan Kim <minchan@kernel.org>,
	Junil Lee <junil0814.lee@lge.com>,
	ngupta@vflare.org, sergey.senozhatsky.work@gmail.com,
	akpm@linux-foundation.org, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org, sergey.senozhatsky@gmail.com
Subject: Re: [PATCH v2] zsmalloc: fix migrate_zspage-zs_free race condition
Date: Sat, 16 Jan 2016 13:09:13 +0900	[thread overview]
Message-ID: <20160116040913.GA566@swordfish> (raw)
In-Reply-To: <56991514.9000609@suse.cz>

On (01/15/16 16:49), Vlastimil Babka wrote:
[..]
> 
> Could you please also help making the changelog more clear?
> 
> >
> >>+		free_obj |= BIT(HANDLE_PIN_BIT);
> >>  		record_obj(handle, free_obj);
> 
> I think record_obj() should use WRITE_ONCE() or something like that.
> Otherwise the compiler is IMHO allowed to reorder this, i.e. first to assign
> free_obj to handle, and then add the PIN bit there.

good note.

... or do both things in record_obj() (per Minchan)

	record_obj(handle, obj)
	{
	        *(unsigned long)handle = obj & ~(1<<HANDLE_PIN_BIT);
	}

	-ss

  reply	other threads:[~2016-01-16  4:10 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-15  7:39 [PATCH v2] zsmalloc: fix migrate_zspage-zs_free race condition Junil Lee
2016-01-15  7:39 ` Junil Lee
2016-01-15 14:34 ` Minchan Kim
2016-01-15 14:34   ` Minchan Kim
2016-01-15 15:49   ` Vlastimil Babka
2016-01-15 15:49     ` Vlastimil Babka
2016-01-16  4:09     ` Sergey Senozhatsky [this message]
2016-01-16  4:09       ` Sergey Senozhatsky
2016-01-16  7:44       ` Vlastimil Babka
2016-01-16  7:44         ` Vlastimil Babka
2016-01-16  8:06         ` Sergey Senozhatsky
2016-01-16  8:06           ` Sergey Senozhatsky
2016-01-16  8:16           ` Vlastimil Babka
2016-01-16  8:16             ` Vlastimil Babka
2016-01-16 10:05             ` Sergey Senozhatsky
2016-01-16 10:05               ` Sergey Senozhatsky
2016-01-18  1:02               ` Junil Lee
2016-01-18  1:02                 ` Junil Lee
2016-01-18  6:32             ` Minchan Kim
2016-01-18  6:32               ` Minchan Kim
2016-01-18  7:04               ` Sergey Senozhatsky
2016-01-18  7:04                 ` Sergey Senozhatsky

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=20160116040913.GA566@swordfish \
    --to=sergey.senozhatsky@gmail.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 \
    --cc=vbabka@suse.cz \
    /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.