From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751121AbcAPHoM (ORCPT ); Sat, 16 Jan 2016 02:44:12 -0500 Received: from mx2.suse.de ([195.135.220.15]:34819 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750874AbcAPHoL (ORCPT ); Sat, 16 Jan 2016 02:44:11 -0500 Subject: Re: [PATCH v2] zsmalloc: fix migrate_zspage-zs_free race condition To: Sergey Senozhatsky References: <1452843551-4464-1-git-send-email-junil0814.lee@lge.com> <20160115143434.GA25332@blaptop.local> <56991514.9000609@suse.cz> <20160116040913.GA566@swordfish> Cc: Minchan Kim , Junil Lee , ngupta@vflare.org, sergey.senozhatsky.work@gmail.com, akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org From: Vlastimil Babka Message-ID: <5699F4C9.1070902@suse.cz> Date: Sat, 16 Jan 2016 08:44:09 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <20160116040913.GA566@swordfish> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 16.1.2016 5:09, Sergey Senozhatsky wrote: > 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< } > > -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: email@kvack.org >