Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp11260122ybi; Thu, 25 Jul 2019 12:55:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqyFFTYu0y1BBdweJchzW+vdK8hdlZYu0zDpT7/wVyQvSESIiad/aCVUVRlfSNf/MlFZOoiE X-Received: by 2002:a65:64c4:: with SMTP id t4mr51135345pgv.298.1564084514662; Thu, 25 Jul 2019 12:55:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564084514; cv=none; d=google.com; s=arc-20160816; b=DxVHXlZFU7ylCm4BL7VeSSGG6yTg/8Ntnyhq/fmHSJeQLx4XxzDalKYnZ4MqZoN2mc jl7wNMXkbUCtZ28zENvi6QAaUff61oJkWQo8R9XWTFETOP4nK2Q3AAZzzclbVYL0iIqa pWEhuFO+DGc/nHx9b7G9aQpNgzsedgOkrXhNOFtD1q82n61gJxNbdktLoahjNNu+xId0 ZwRCrCMLpCx/25oqOPkVl17F7AAVQHfufmSAZrkBCCtC1+rLV5fS+OQeHAbhut8Ai+vl 5c+H749FcwdCkcy2zj4fLEW/jhyfIkG//VewzpxaET2+k1NC31D6oy7phZh73oO8RpnB UO5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=SdMjmK8iF0mB7yTHT03TVjV+HGY1IT0xeAV8t1i/ACs=; b=Y5FCgO8CTqCy0rKbWHn5HuISl+TqaHcXYP5YiSAce3T8hZ5m4rLwNVu7nKqHpCwnE1 j1mncCLR/kfTf2cBn4IIpphiYEqFOMkddtu3FTAPP9wK1ah6C2eS/b6YKfpTKujPBqxn a0q6kQhRGHDiZhd9oWxNFBAnLscJwlj1xWAJ7PciFs1m793gR6nVID3tOkwA8nYP1Ma7 iXMJkhTSUz2g9U5eowHF1YgfnV0hb5JdXzzZsab7h4HDR4WxjybyvThW6criZ1ZvVig4 4gugiQZF7v/u846qEssOl/7/X9kZaM1dMosATxY4xe4ehZ9A6NyeQVdjdNHKEzwiKG34 /G1A== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b23si15589797pjp.62.2019.07.25.12.54.58; Thu, 25 Jul 2019 12:55:14 -0700 (PDT) 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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726265AbfGYTyX (ORCPT + 99 others); Thu, 25 Jul 2019 15:54:23 -0400 Received: from mga07.intel.com ([134.134.136.100]:62331 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725923AbfGYTyX (ORCPT ); Thu, 25 Jul 2019 15:54:23 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Jul 2019 12:54:22 -0700 X-IronPort-AV: E=Sophos;i="5.64,307,1559545200"; d="scan'208";a="175354533" Received: from ahduyck-desk1.jf.intel.com ([10.7.198.76]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Jul 2019 12:54:21 -0700 Message-ID: <0530d9d32a7316adee62e067cb0fb8048f97da84.camel@linux.intel.com> Subject: Re: [PATCH v2 5/5] virtio-balloon: Add support for providing page hints to host From: Alexander Duyck To: Nitesh Narayan Lal , Alexander Duyck , kvm@vger.kernel.org, david@redhat.com, mst@redhat.com, dave.hansen@intel.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, akpm@linux-foundation.org Cc: yang.zhang.wz@gmail.com, pagupta@redhat.com, riel@surriel.com, konrad.wilk@oracle.com, lcapitulino@redhat.com, wei.w.wang@intel.com, aarcange@redhat.com, pbonzini@redhat.com, dan.j.williams@intel.com Date: Thu, 25 Jul 2019 12:54:21 -0700 In-Reply-To: References: <20190724165158.6685.87228.stgit@localhost.localdomain> <20190724170514.6685.17161.stgit@localhost.localdomain> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.30.5 (3.30.5-1.fc29) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2019-07-25 at 13:42 -0400, Nitesh Narayan Lal wrote: > On 7/24/19 1:05 PM, Alexander Duyck wrote: > > From: Alexander Duyck > > > > > > @@ -924,12 +956,24 @@ static int virtballoon_probe(struct virtio_device *vdev) > > if (err) > > goto out_del_balloon_wq; > > } > > + > > + vb->ph_dev_info.react = virtballoon_page_hinting_react; > > + vb->ph_dev_info.capacity = VIRTIO_BALLOON_ARRAY_HINTS_MAX; > > + if (virtio_has_feature(vb->vdev, VIRTIO_BALLOON_F_HINTING)) { > > + err = page_hinting_startup(&vb->ph_dev_info); > > + if (err) > > + goto out_unregister_shrinker; > > + } > Any reason why you have kept vb->ph_dev_info.react & vb->ph_dev_info.capacity > initialization outside the feature check? I just had them on the outside because it didn't really matter if I initialized them or not if the feature was not present. So I just defaulted to initializing them in all cases. Since I will be updating capacity to be based on the size of the hinting queue in the next patch set I will move capacity initialization inside of the check.