Message ID | 1544628195-37728-10-git-send-email-pbonzini@redhat.com |
---|---|
State | New |
Headers | show
Return-Path: <qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=<UNKNOWN>) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="OgbguIwU"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43FLG53RWcz9s4s for <incoming@patchwork.ozlabs.org>; Thu, 13 Dec 2018 02:24:45 +1100 (AEDT) Received: from localhost ([::1]:45563 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>) id 1gX6NO-0000zH-NJ for incoming@patchwork.ozlabs.org; Wed, 12 Dec 2018 10:24:42 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52039) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <paolo.bonzini@gmail.com>) id 1gX6MO-0000f5-Es for qemu-devel@nongnu.org; Wed, 12 Dec 2018 10:23:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <paolo.bonzini@gmail.com>) id 1gX6MI-0008V7-Qu for qemu-devel@nongnu.org; Wed, 12 Dec 2018 10:23:38 -0500 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]:46520) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from <paolo.bonzini@gmail.com>) id 1gX6MG-0008Qh-Us for qemu-devel@nongnu.org; Wed, 12 Dec 2018 10:23:33 -0500 Received: by mail-wr1-x42a.google.com with SMTP id l9so18047166wrt.13 for <qemu-devel@nongnu.org>; Wed, 12 Dec 2018 07:23:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references; bh=ohNPlITjNo9ZpAsml58lXHZNCGfnAWqPmz2U8SwFAFA=; b=OgbguIwUiLniqEpRGDAzHiI2vDStkWPGROpXrMkXgX8zFdWT3S67BOiYAUlgLrIkTo RxYx36/S1f7LJTwoqbL6fazLon4ShZVF86wuXrHREjI+MDT0duqT9vY16SOIojTcwae7 sudwzn0yPbrT4ZXIiAamfrRjUK2JaQ+6C0rqPWZZESgDM/B6V7VjRQW+1J3fhcGUzQVw dzzkXH0pYNhdjGUcdcmQJarrm0G+b/SUiRAf+5rTCKhJ+htC6hdBtwC7X0qxV84sg6xd 3mZHeUDETKpm0et7Qt7Xh9UKYm4dO0dc4mSmdM0ZNbohW+sG0w1pljZSgIik5auOJUve f+Gw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references; bh=ohNPlITjNo9ZpAsml58lXHZNCGfnAWqPmz2U8SwFAFA=; b=DXZsEsFq0btG7fMcbkKJBVPRaWoFFn2Qwy5QVpliCRdlIeIgR1gVGROEXi6Op8mRhY 4HWGLytuDx8o4472V8FrzcqeDnoaVoHCzY8ofmlFnmKrOH30WZwP0VlTSdu3UN9+P3Md 0RnexWnK/kjJVJoisUtSP8bxmhc/7cz7DqZUYUQzaHtwdowmHTPk6HDrrDoqFGyZ3YPw 1gmSwbpkeE2pYj7ofXO2pIZgqUIFF9PoObKeD10HFQ61JWPwup0v60JBCGyaD8hVN9tI +6oKJshYjsJwd+Bq4uZj11mQ9yLIS5xAnzji4czR985wI4B7/BKeTLK4Dq9udq+CEFqt yQTQ== X-Gm-Message-State: AA+aEWaCdabsd8oaerzCMwGb/LrkTkleI04t+GBwle9JFoOr6hFrJEHj vTk03vl/6QKekzY7T1+Lu/PGkbdz X-Google-Smtp-Source: AFSGD/XrMxyyu3m3YE4UtDNb4toJE5NvgTmoyCMS8KFe59th4w1kTtpVJnEHR5+P96ao4SDvhCMseQ== X-Received: by 2002:adf:fe43:: with SMTP id m3mr17056367wrs.290.1544628209495; Wed, 12 Dec 2018 07:23:29 -0800 (PST) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id u10sm15878859wrr.33.2018.12.12.07.23.27 for <qemu-devel@nongnu.org> (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 12 Dec 2018 07:23:28 -0800 (PST) From: Paolo Bonzini <pbonzini@redhat.com> To: qemu-devel@nongnu.org Date: Wed, 12 Dec 2018 16:22:30 +0100 Message-Id: <1544628195-37728-10-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1544628195-37728-1-git-send-email-pbonzini@redhat.com> References: <1544628195-37728-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::42a Subject: [Qemu-devel] [PULL 09/54] memory: avoid unnecessary coalesced_io_del operations X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <http://lists.nongnu.org/archive/html/qemu-devel/> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" <qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org> |
Series |
[PULL,01/54] accel: Improve selection of the default accelerator
|
expand
|
diff --git a/memory.c b/memory.c index 119b6e4..072769a 100644 --- a/memory.c +++ b/memory.c @@ -217,6 +217,7 @@ struct FlatRange { bool romd_mode; bool readonly; bool nonvolatile; + bool has_coalesced_range; }; #define FOR_EACH_FLAT_RANGE(var, view) \ @@ -650,6 +651,7 @@ static void render_memory_region(FlatView *view, fr.romd_mode = mr->romd_mode; fr.readonly = readonly; fr.nonvolatile = nonvolatile; + fr.has_coalesced_range = false; /* Render the region itself into any gaps left by the current view. */ for (i = 0; i < view->nr && int128_nz(remain); ++i) { @@ -852,6 +854,10 @@ static void address_space_update_ioeventfds(AddressSpace *as) static void flat_range_coalesced_io_del(FlatRange *fr, AddressSpace *as) { + if (!fr->has_coalesced_range) { + return; + } + MEMORY_LISTENER_UPDATE_REGION(fr, as, Reverse, coalesced_io_del, int128_get64(fr->addr.start), int128_get64(fr->addr.size)); @@ -863,6 +869,11 @@ static void flat_range_coalesced_io_add(FlatRange *fr, AddressSpace *as) CoalescedMemoryRange *cmr; AddrRange tmp; + if (QTAILQ_EMPTY(&mr->coalesced)) { + return; + } + + fr->has_coalesced_range = true; QTAILQ_FOREACH(cmr, &mr->coalesced, link) { tmp = addrrange_shift(cmr->addr, int128_sub(fr->addr.start,
Store whether the FlatRange has had any coalesced I/O ranges applied, and if not avoid calling coalesced_io_del. This is useful in preparation for the next patch, which will call coalesced_io_del when rendering memory regions. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> --- memory.c | 11 +++++++++++ 1 file changed, 11 insertions(+)