Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2232307ybl; Sat, 14 Dec 2019 08:27:52 -0800 (PST) X-Google-Smtp-Source: APXvYqwsdoPbCIEBsHFqbqpA8vEvcBMl8ZDrrDyZE0L0JmJhZVqjatvi8qD12Gy0pOYLo8Xwg0oE X-Received: by 2002:a05:6830:1c8a:: with SMTP id v10mr20144731otf.115.1576340871975; Sat, 14 Dec 2019 08:27:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576340871; cv=none; d=google.com; s=arc-20160816; b=hOY9UEKvWvbpFawQi3mnbKncBa0oBgGb33CIBnPZexeSXd9xa31X9HUTuGEuBvXdFJ xeRPfz/jhF07cKgPtYXVp5TFQW1BTHQaVeKmFT2m7aYpmiTXmew1z0XW84TyWoKfLvi2 ezchUcP/KIRMfNKvJ4IxEDlWGd1m13hgYWDB5/2FrzUKwPv63Gryk3NoXWrM5a9UWipB GSGfK8q+epdc1kdVh5zMnGM8N3+5uuvzCLRWTbH5dIEagPzKjjCjLmhXYwgCuRDHRXzk 8NmGabVJ1sJTszX16YBoxjQ26KsXcydN0qJTr/lWFQWDhf/sxVHR/nOlG/rBh26szo9z Hpgg== 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=xTCcQEsnViYyDThiiPsB7XBVprrCPkwPyCcp1A4bdWA=; b=fRjDJ3/ZSGdfzFey5Adabx3sHJr/u77qA/0A1g/a68dpG/E+a7bta6eXS1gxdywkav eHjCmlhhxvVFvQTsAvqNdJ4nJwTjSd0hODOdJYAqd7QYxROnd2rJaAGrywRsiY6Mahci bWBqdF9XvedLdFmM9hlae/AFOo4xV1BXZj/iYPsGqD5Io8nL8rsKIwlUo2xbCauuYiu5 Dr+EWjDriX0lGgV/bqY2s3FKCjkkyw9wmEVYsWrizB0ILpjUpEnHYDfubTJ7wp2fmBES Rop7a1QstiVkPh9pD6/cvfuUuSu2UYDlQ0ploaQvcPJXUcg66ffTx2CBUBeR9ZYpt2ev VjNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="WizkkZB/"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x207si6803085oif.30.2019.12.14.08.27.39; Sat, 14 Dec 2019 08:27:51 -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=@redhat.com header.s=mimecast20190719 header.b="WizkkZB/"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726411AbfLNQ0u (ORCPT + 99 others); Sat, 14 Dec 2019 11:26:50 -0500 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:44138 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725884AbfLNQ0u (ORCPT ); Sat, 14 Dec 2019 11:26:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576340808; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=xTCcQEsnViYyDThiiPsB7XBVprrCPkwPyCcp1A4bdWA=; b=WizkkZB/8YOV783Jz/x9qmAk6cH/8/1Awg4zMmJ/srhkIXvNLA34fV2bDWjLAV/QZzsFvD NlQS/LbQQoakPmXtj2cQLG6nHA8zYnppm0R6p5tc+n0BNmlVpgb1dCYzFJYAeVy37UG0b2 WcUJQaKwXiRLqNhjcWOy5EvY/epvAsQ= Received: from mail-qt1-f199.google.com (mail-qt1-f199.google.com [209.85.160.199]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-373-NVir-X9MOmSMmyF3d1y8yQ-1; Sat, 14 Dec 2019 11:26:47 -0500 X-MC-Unique: NVir-X9MOmSMmyF3d1y8yQ-1 Received: by mail-qt1-f199.google.com with SMTP id v25so1602991qtq.3 for ; Sat, 14 Dec 2019 08:26:47 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=xTCcQEsnViYyDThiiPsB7XBVprrCPkwPyCcp1A4bdWA=; b=YMxY1eWteETwEBhcJ/ZZfRWazxkdnJucq4Og3+aukMuDoFe71DwKqQn3r9+MWJ2svD O1lLcraDrt0w5503q2r+pTYPMqEJuQDBE0TIoP3YYe2Ck3+8attvb0W3bTtblQK+c4hm J/4syaYpP0XGElRPrY2ioP6Cu95YCCpcW6ZZe7sj6C0hiAFL7uuAL0NnHZ3M3jXYz9hG jwIlW/+IoQJUCXAusw4ylBp0YcJ1uQJ1lnR38j5oDhrt8AY1nswPdtkGleOMWCyDlU0K nFAStXFMxoUfLqqDH33cEKTx0woQ0q1euRZ0+fz1Ze9OABrR7fLPmabLfrt6UsRFoggb iuyA== X-Gm-Message-State: APjAAAXRFH5NUpjQLlZwqwSv7kj6zGX6R1eJ6HzHZ7EMYokL6w3prRe7 vnl8qqtWcEl+9J64FNnHcfx9yhRXp2vRpi675kXIpDLC5tV5HiOC0tvChC53suOBQDJdlAIoNxn NpvRgk0J6rwfVpYs/4g/1LIju X-Received: by 2002:a05:620a:1265:: with SMTP id b5mr19414255qkl.172.1576340807180; Sat, 14 Dec 2019 08:26:47 -0800 (PST) X-Received: by 2002:a05:620a:1265:: with SMTP id b5mr19414237qkl.172.1576340806921; Sat, 14 Dec 2019 08:26:46 -0800 (PST) Received: from xz-x1 ([2607:9880:19c0:3f::2]) by smtp.gmail.com with ESMTPSA id z141sm2911860qkb.63.2019.12.14.08.26.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 14 Dec 2019 08:26:46 -0800 (PST) Date: Sat, 14 Dec 2019 11:26:44 -0500 From: Peter Xu To: Paolo Bonzini Cc: Christophe de Dinechin , linux-kernel@vger.kernel.org, kvm@vger.kernel.org, Sean Christopherson , "Dr . David Alan Gilbert" , Vitaly Kuznetsov Subject: Re: [PATCH RFC 04/15] KVM: Implement ring-based dirty memory tracking Message-ID: <20191214162644.GK16429@xz-x1> References: <20191129213505.18472-1-peterx@redhat.com> <20191129213505.18472-5-peterx@redhat.com> <20191213202324.GI16429@xz-x1> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Dec 14, 2019 at 08:57:26AM +0100, Paolo Bonzini wrote: > On 13/12/19 21:23, Peter Xu wrote: > >> What is the benefit of using u16 for that? That means with 4K pages, you > >> can share at most 256M of dirty memory each time? That seems low to me, > >> especially since it's sufficient to touch one byte in a page to dirty it. > >> > >> Actually, this is not consistent with the definition in the code ;-) > >> So I'll assume it's actually u32. > > Yes it's u32 now. Actually I believe at least Paolo would prefer u16 > > more. :) > > It has to be u16, because it overlaps the padding of the first entry. Hmm, could you explain? Note that here what Christophe commented is on dirty_index, reset_index of "struct kvm_dirty_ring", so imho it could really be anything we want as long as it can store a u32 (which is the size of the elements in kvm_dirty_ring_indexes). If you were instead talking about the previous union definition of "struct kvm_dirty_gfns" rather than "struct kvm_dirty_ring", iiuc I've moved those indices out of it and defined kvm_dirty_ring_indexes which we expose via kvm_run, so we don't have that limitation as well any more? -- Peter Xu