Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp860518pxk; Thu, 3 Sep 2020 14:40:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxcaN1r1meryw91l7zwzV/qumsigbUn0kKa97Mv60zG8ATOpSbAjj/Q2pgFCQWj0WkaOfn6 X-Received: by 2002:a05:6402:10d7:: with SMTP id p23mr5175998edu.388.1599169217270; Thu, 03 Sep 2020 14:40:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599169217; cv=none; d=google.com; s=arc-20160816; b=vAvWvwV3ZUfnpy17DJsJBPXIEt9VfkTKm9BRiWjQz7vtvGXUsWSYMsMVrTOTlZxZJZ WUkO0zWXA4o++ZbGj7dp/dVn8NlpqGVe/E+Gro5wywtEl2ZqMcBzJoX3o5SxvrpX0mSM yrea9AuTC7Gt+QBASe6r6cThnzqrT77ZTuVXQPES37Z8N8kK6g7yrNLJZVX8ihsnxsAe UvNibaneUrorHElOrRkiI6zBg4RprTik8oSU2FlMnjFW8fOaRzYVPWEVkuCoMlKMRpMg PW5mk9ufMvRIrla/zGcHMP+irrmExqxmafoiK0qxDsDqMEPXnF5FatBrRb7HgD1cRhuf jzYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature:dkim-filter; bh=X8Rl+pt4VyViVuY1iqvZwrKvgNYzoNtbk1C/H/rtsqg=; b=jed+OfjQPzLxJCAjuccEMxWzSFsJK/htwF340kHm5Bn0S3Ft4MmJLOm4XJIE3ZIBYe HY5TWUuC58Lhrr2Sq1AYKdFqqdStBinwTzQb4ppGqRGCARH4DTO6cg/KLxE6VM6+ERBT ZHOSx3TSmoSCJEJLRKoFk7RtZfD3QWRGzrlar6mM70K35q9k0Af8onra0bBfP7NicEhx h5a78qvwmdDemKcL2Ieh8mgJj/ppjoJgxSoIxnkMkuvw59gWyTEp99spgMmOkzYaZoXG Eo3wmLBSF9fdG8pzp5GMPc00MtA0Q+YPU2Md0TJ7I20DV0VZfvkL0PkYDxDcXjYFAXVK BJHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=SExMy0z8; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i24si2503471edr.73.2020.09.03.14.39.53; Thu, 03 Sep 2020 14:40:17 -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=@linux.microsoft.com header.s=default header.b=SExMy0z8; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728129AbgICVjG (ORCPT + 99 others); Thu, 3 Sep 2020 17:39:06 -0400 Received: from linux.microsoft.com ([13.77.154.182]:41924 "EHLO linux.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726528AbgICVjG (ORCPT ); Thu, 3 Sep 2020 17:39:06 -0400 Received: from [192.168.1.17] (50-47-107-221.evrt.wa.frontiernet.net [50.47.107.221]) by linux.microsoft.com (Postfix) with ESMTPSA id 8E42720B7178; Thu, 3 Sep 2020 14:39:05 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 8E42720B7178 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1599169145; bh=X8Rl+pt4VyViVuY1iqvZwrKvgNYzoNtbk1C/H/rtsqg=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=SExMy0z8l+hDET7uI+Q/LNihF/CkCSNZ8/8iWyTqCJFtunIbCKQmGIlnxcQQoSEw9 wTLpR6SMvrJNUoIQeSmNFde5tb81gNlLJAMBZKnx87bD/JKDYMXi9ndvXvHHM3XkW5 U0L+cGCVCwZ2IZFT7EOH8m4VX+zfBoqxo46/U+lQ= Subject: Re: [PATCH 1/4] drivers: hv: dxgkrnl: core code To: Greg KH Cc: Pavel Machek , Sasha Levin , kys@microsoft.com, haiyangz@microsoft.com, sthemmin@microsoft.com, wei.liu@kernel.org, iourit@microsoft.com, linux-kernel@vger.kernel.org, linux-hyperv@vger.kernel.org, spronovo@microsoft.com References: <20200814123856.3880009-1-sashal@kernel.org> <20200814123856.3880009-2-sashal@kernel.org> <20200821135340.GA4067@bug> <054abab3-748e-c56b-526a-1b1734a9eaf7@linux.microsoft.com> <20200828061840.GE56396@kroah.com> From: Iouri Tarassov Message-ID: Date: Thu, 3 Sep 2020 14:39:05 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <20200828061840.GE56396@kroah.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Greg, On 8/27/2020 11:18 PM, Greg KH wrote: > On Thu, Aug 27, 2020 at 05:25:23PM -0700, Iouri Tarassov wrote: > > > > +bool dxghwqueue_acquire_reference(struct dxghwqueue *hwqueue) > > > > +{ > > > > + return refcount_inc_not_zero(&hwqueue->refcount); > > > > +} > > > > > > Midlayers are evil. > > I strongly agree in general, but think that in our case the layers are very > > small. It allows to quickly find all places where a reference/dereference on > > an object is done and addition of debug tracing to catch errors. > > Again, no, please remove all layers like this. They just make it > impossible for others to review and understand the code over time. > > Also, in this specific case, it would have allowed me to easily realize > that you are doing this type of call incorrectly and should be using a > different data structure :) Are you suggesting that the current code is incorrect? Could you comment what changes need to be done? Thanks Iouri