Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2777304pxk; Sun, 27 Sep 2020 22:26:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy1wR6U2eCIGq3OjIWE7sS7bKg0AekCdNNHDNwTodNXmegNQSP8hAhup56PKOsdyUbfDDsq X-Received: by 2002:a05:6402:1612:: with SMTP id f18mr13542436edv.166.1601270813692; Sun, 27 Sep 2020 22:26:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601270813; cv=none; d=google.com; s=arc-20160816; b=EnjO53XbHhgzVJwPTbK3bt8xzqJ08j+1WGnCJFOR+orLo3dpTrhbGLJTGfGRTg45yy dAsJNwe9MRGQCqJK3hiROKM3fW4eQBPIsRdbk+RwWzCXWALacDeyCor9Yrg33vs2LOFs mbF7LrQJe+22azQblNs2YF9NMzgx44KQx0xPIrJKUXodYvdRjIcamH6OxMRAv45zEXKv KFdE5aEsmUxhkAh8qRBrItqKSNhzBUz0k7OT7fkTl0whbBGqvxmSm8ubkxr1Mluvi2/f wAeqngRwR2iDwZahRObgp27fDbz6PSHkK5NToIR4+2anfKDXniQEqcqLzetPBMOC+b2j 4Qtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=zqebliN+vil9ePO/GsVc9hlIPbGqNK+XjabjyMHaTY0=; b=tXt0KZhYk8kjLZar6Bmmq2GmGAZuL7y26I21iL4IhrmqpvP2RKZOKwPe0WNPXQcoRj fJ40PgEfcEw8QSZSV55Z/Ub5fK4nRrwQobOnNj4trtvfAK3G68IzJJ5LiAuppMyoFMVy Hda6QyK3vAnwDjYltEnCxwb/k8olIehwKNOmjcTv5fBUnfURpHnfm5QKubiMJYcViW6U AiLxTm1tGqIirZoBk7Pi5oQ46aSzwy6CogsiALPkSkTIjYiyxptbqEqb+c5guk+aUgtX T9hCKbafDgz3vkVyClwA0edHKsP7vlZXXO93gy/a3fZrPZScquUuJ9lFqDJWi/AUcPBd lxdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=JFNeUYsU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c21si7334549edw.18.2020.09.27.22.26.31; Sun, 27 Sep 2020 22:26:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=JFNeUYsU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726513AbgI1FZV (ORCPT + 99 others); Mon, 28 Sep 2020 01:25:21 -0400 Received: from mail.kernel.org ([198.145.29.99]:47878 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725290AbgI1FZV (ORCPT ); Mon, 28 Sep 2020 01:25:21 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 9064C22574; Mon, 28 Sep 2020 05:25:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601270720; bh=wBja5Fw4x4UnSssX+xKch7t0labtipJpxl4uYrmPQ2Q=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=JFNeUYsU7v1joVB01Z40TosTQv5FHITHYf85PAynGj3wi/Tr3k72e2H/y+plnY12p 9hsNE5kQxc94D9VGjSk79QWumWRpxwBr/nwCg8KpeiQkglfOOyRtEfGCCdCuHO72eS GFuRLl3uAzU0V+w4zsYg1o6SPpp9dQeXsEm7T2gM= Date: Mon, 28 Sep 2020 07:25:16 +0200 From: Greg Kroah-Hartman To: Shuo A Liu Cc: linux-kernel@vger.kernel.org, x86@kernel.org, "H . Peter Anvin" , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Sean Christopherson , Yu Wang , Reinette Chatre , Zhi Wang , Zhenyu Wang Subject: Re: [PATCH v4 06/17] virt: acrn: Introduce VM management interfaces Message-ID: <20200928052516.GD767987@kroah.com> References: <20200922114311.38804-1-shuo.a.liu@intel.com> <20200922114311.38804-7-shuo.a.liu@intel.com> <20200927104702.GE88650@kroah.com> <20200928035030.GD1057@shuo-intel.sh.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200928035030.GD1057@shuo-intel.sh.intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 28, 2020 at 11:50:30AM +0800, Shuo A Liu wrote: > > > + write_lock_bh(&acrn_vm_list_lock); > > > + list_add(&vm->list, &acrn_vm_list); > > > + write_unlock_bh(&acrn_vm_list_lock); > > > > Why are the _bh() variants being used here? > > > > You are only accessing this list from userspace context in this patch. > > > > Heck, you aren't even reading from the list, only writing to it... > > acrn_vm_list is read in a tasklet which dispatch I/O requests and is wrote > in VM creation ioctl. Use the rwlock mechanism to protect it. > The reading operation is introduced in the following patches of this > series. So i keep the lock type at the moment of introduction. Ok, but think about someone trying to review this code. Does this lock actually make sense here? No, it does not. How am I supposed to know to look at future patches to determine that it changes location and usage to require this? That's just not fair, would you want to review something like this? And a HUGE meta-comment, again, why am I the only one reviewing this stuff? Why do you have a ton of Intel people on the Cc: yet it is, once again, my job to do this? If you all are wanting to burn me out, you are doing a good job... greg k-h