Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1901359imu; Fri, 23 Nov 2018 01:45:39 -0800 (PST) X-Google-Smtp-Source: AFSGD/V6xpkBi0Jlw+uR/0FeyEit3ln+d8mAhbJRNbobns1G1AUR4A1pGZ+NKfIo7LbDtj8MrfIo X-Received: by 2002:a65:624c:: with SMTP id q12mr13436505pgv.379.1542966339659; Fri, 23 Nov 2018 01:45:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542966339; cv=none; d=google.com; s=arc-20160816; b=CtAFK5tJbRzDyba5309xZcuC7TKMnSC7ZVg7SxzL+hLAAQ2PpTDXnRRuWb9jUIUY8w s/LUrpq/1R4PH6BJ2XHd5BWB7QKQP85Jg3GNiBCOGMntpV9zyUPTiDgFjcpB993J6ELJ pabl8KU3UxLa6Ks/TVhaM9GgQ0p+4U2SSJm4q+gJjtNCj7DNlMRKxamMrtvB69IdBAUY 75PgdCF7RS2IsHWPgtBMoKEitV8PH6EPYfavzOrtfVkPEuMv/T7hkxHeQl8piEssvD5X vU2c1ACJNer8Q2/pqBj9JibeB2zYma30sGeVmsNbAEffiJfiVica01SQ9odB9Qhj2Zkn uwgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=x1yIZgHxvMUfchE5joh4uN/fDokOBhYdQRm1viyFxmE=; b=oKHOyUmG/LsPlqHOGYhyyC7lVs1yZRtFPAzi6YfMYbQ3AOKbw2fmmKuCPdfGrsKArt +mji2hYwdDVPpBm6N+WI4CiSUPGsuoKQfC8t258+BGRVdqSNIu0qQQySor1ijItfCGXS JOkMju/Y7UvgV6c/fOLI65I0Y/N6sMzIlYVsCKG0WgWU32eL5FaFekhEmyij9g0iRgKn ZMPleyr6rfiW29+24E9VrmhUxYs4EB3GWCss/Keh99HHVIayc1bKalL9tdYX3SXGXkPk q0x0ai2iDOLgcAx+oEnouDEd+AXxmoVFseQEU7Vd0W5ynmzt5SmM8yaR1vOcG1SLOzhZ hK8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=zP3HATwJ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h91si16996482pld.411.2018.11.23.01.45.24; Fri, 23 Nov 2018 01:45:39 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=zP3HATwJ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2394508AbeKVVoc (ORCPT + 99 others); Thu, 22 Nov 2018 16:44:32 -0500 Received: from mail.kernel.org ([198.145.29.99]:42012 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388478AbeKVVob (ORCPT ); Thu, 22 Nov 2018 16:44:31 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C949B20820; Thu, 22 Nov 2018 11:05:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1542884737; bh=NEl5SfX9wQ5A50uQSuYsdNM2UBgxb0nU8m4gfyAu8R4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=zP3HATwJbcT4PSLL1i143eyjWYfWVyMSn1Cikx2JAqx92BgcO8+EhNFDQ/+4XqPPv GgMrdCJ1RxkBEmwz0+1c+HzdfVu2XTDDkdElthoHaQ678cL1WW8oqsnyiOT+gODoo3 bCTsvHl/Ai0jI1F++vdJgEYm1tTes79QnL/3glP0= Date: Thu, 22 Nov 2018 12:05:34 +0100 From: Greg Kroah-Hartman To: Gao Xiang Cc: devel@driverdev.osuosl.org, linux-erofs@lists.ozlabs.org, Chao Yu , LKML , weidu.du@huawei.com, Miao Xie Subject: Re: [PATCH 04/10] staging: erofs: fix `erofs_workgroup_{try_to_freeze, unfreeze}' Message-ID: <20181122110534.GD5287@kroah.com> References: <20181120143425.43637-1-gaoxiang25@huawei.com> <20181120143425.43637-5-gaoxiang25@huawei.com> <20181122102155.GE3189@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 22, 2018 at 06:29:34PM +0800, Gao Xiang wrote: > Hi Greg, > > On 2018/11/22 18:21, Greg Kroah-Hartman wrote: > > On Tue, Nov 20, 2018 at 10:34:19PM +0800, Gao Xiang wrote: > >> There are two minor issues in the current freeze interface: > >> > >> 1) Freeze interfaces have not related with CONFIG_DEBUG_SPINLOCK, > >> therefore fix the incorrect conditions; > >> > >> 2) For SMP platforms, it should also disable preemption before > >> doing atomic_cmpxchg in case that some high priority tasks > >> preempt between atomic_cmpxchg and disable_preempt, then spin > >> on the locked refcount later. > > > > spinning on a refcount implies that you are trying to do your own type > > of locking. Why not use the in-kernel locking api instead? It will > > always do better than trying to do your own logic as the developers > > there know locking across all types of cpus better than filesystem > > developers :) > > It is because refcount also plays a role as a spinlock on a specific value > (== EROFS_LOCKED_MAGIC), no need to introduce such a value since the spin > window is small. As I said in another email, doing two things with one variable is odd as those are two different types of functions. greg k-h