From patchwork Fri Jul 23 17:03:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 484647 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp1523031jao; Fri, 23 Jul 2021 10:13:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxRoR8hjh8CeaKFzw7dNoD6AfhRI5OIV3mnfvQMfq1FO51sJruyg6ccJI2VvHjrzRrz7Q3x X-Received: by 2002:ab0:3094:: with SMTP id h20mr5499663ual.141.1627060391861; Fri, 23 Jul 2021 10:13:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627060391; cv=none; d=google.com; s=arc-20160816; b=bBMr9xXGJ2GQKj+nYN0a+FVwTNmPOInR5/BD+ap2KS16RERQSYNWfqo3aoPCO6vgGZ RPUH0ZQAVmXW0sZ6Y+7hWP8P3sYPJPK3ZfSfdpSRYf4eQHhOFG6MyxKmscJ90qTBpHET y5AFmsxu5D1+9sRYZrxM37XLBMVN+YvBBuBhg4XFO3XNDCwZDhKSkYtql63WENTxXj/k hxbk2m5ILovUtV7XxMl7wpa4bEHE1J9DsgqGYSJOI1f+MDXzoBOgi6jUpPRfuqMErCzy EtvKdgwrggpMbbHP6HIqLCRmfjjya4yopchypbRrHtCiXWAhlS+vXO6kq8KZcJkd/8XN I9DQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=yQMjndH/iLO2WTUcjBFbZ9uTKhmeZTZ3TcLfo5Nk7So=; b=hOnW0oYjs7moOIN2plhG5vUyN9wPR2Kqf3qSfXXGmQG5UnVngHKVIvnGH7RlFE46he ong4+1RdKTD1ik3H49mEUXl1+pugS9hzPFiWkzechXSAEHam5BS7Eiwe5p4IH3/ZaPRe w0CGUChdKX+5aCm7La6Vs69szcl/p9yyAD9bGWBJ4tDHtorkhN6LQdURZ20UXZ+gxE/X MC0weYqniD6G2BIHdAmtKY0xXQF1FEqtO5jqMz4d+JgSSm+TVoVkjnYhJHRSI/DmRlYI y0Nd2kdWcLhSadjtN50pdqoVR4+Qs78dniVJZjPhj+nik320/9KwyeQnPmyQNKd6NdLD 0Rvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=KiPDTyzX; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id b24si24080736vsj.305.2021.07.23.10.13.11 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 23 Jul 2021 10:13:11 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=KiPDTyzX; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:60610 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m6yjX-0000iA-94 for patch@linaro.org; Fri, 23 Jul 2021 13:13:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58698) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m6ybv-0002gM-86 for qemu-devel@nongnu.org; Fri, 23 Jul 2021 13:05:19 -0400 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]:37576) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m6ybq-0005vi-RK for qemu-devel@nongnu.org; Fri, 23 Jul 2021 13:05:18 -0400 Received: by mail-wr1-x434.google.com with SMTP id l4so3098079wrs.4 for ; Fri, 23 Jul 2021 10:05:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=yQMjndH/iLO2WTUcjBFbZ9uTKhmeZTZ3TcLfo5Nk7So=; b=KiPDTyzXEIjb75ARIypTIYeM3dQimI02g/Ir+cJR1Xy6Y6RlEwpG9CVhf1o4pXgXhP BzH+2bQVzcPYCVVmG1p1+Q2HSMbSVPpwYA3tfPCPGGXH6yMCXcIgtnOgggXEdHa5PhAj 8JN+qfQzZj61lGqVVi0NjYIMdTxcUm2GJj4rIbgTAIHl7FFb7o0vTA7JtmgJgU04wrAd ykiNqciAtNzMGq+F16VMhgJDTdL4kXcGLRCWYVT4Ug3zsE/kM+wkuhTJ/XZ9kuyDIOhy mk+iSHQiHfbW/Hf2ufrfJWmhcwxv7o3rhEWr21Nwbb9lRRa4/WvI5Sd3bTPOp95jdEPD En2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=yQMjndH/iLO2WTUcjBFbZ9uTKhmeZTZ3TcLfo5Nk7So=; b=N+qTmTMOHkA7fT7WdQU0khjm9ljVLx8pckw+/n/fiXeReueRDO1h57Z64AIWKvn0o5 Zml30P2kHKVXsuQtcaX8dPIjEOUkSF/OHIOcU/+7in+y4ky411HwI7IUVjvF6BuSmlki Oe2GlIV1sl+gIHUkmqTn9QhOlsf9QRAkzZ3FDrUTCl8OuSpDydXaNTbnbR2i/2Xnn6Y1 9QBkuLbDQaPflM19joix6WRVsWqBvlxF6yAvuVgNlSBWsnD3bsoYA1M2RVfIykPHaxPh Luk+6yIr/vVmV8OSFX9eEGyvupeTmx65ocBdhYR1r2CAjrMKuS2mOxiIoG9NXlTa+kLy IU6g== X-Gm-Message-State: AOAM532WOYL04RKX8tbgAhHbL3r3Rb58DtkGtz2gKUE16eddUOXAZSAb xxcqiovEg8mSllFbOrZM+emdIw== X-Received: by 2002:a5d:5589:: with SMTP id i9mr6262028wrv.8.1627059913453; Fri, 23 Jul 2021 10:05:13 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id e11sm41280731wrt.0.2021.07.23.10.04.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Jul 2021 10:04:40 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 27DCC1FFAB; Fri, 23 Jul 2021 18:03:56 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 21/28] plugins/cache: Fixed a bug with destroying FIFO metadata Date: Fri, 23 Jul 2021 18:03:47 +0100 Message-Id: <20210723170354.18975-22-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210723170354.18975-1-alex.bennee@linaro.org> References: <20210723170354.18975-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::434; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x434.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alexandre Iooss , Mahmoud Mandour , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Mahmoud Mandour This manifests itself when associativity degree is greater than the number of sets and FIFO is used, otherwise it's also a memory leak whenever FIFO was used. Signed-off-by: Mahmoud Mandour Signed-off-by: Alex Bennée Reviewed-by: Alex Bennée Message-Id: <20210714172151.8494-2-ma.mandourr@gmail.com> Message-Id: <20210720232703.10650-22-alex.bennee@linaro.org> -- 2.20.1 diff --git a/contrib/plugins/cache.c b/contrib/plugins/cache.c index bf0d2f6097..4a71602639 100644 --- a/contrib/plugins/cache.c +++ b/contrib/plugins/cache.c @@ -200,7 +200,7 @@ static void fifo_destroy(Cache *cache) { int i; - for (i = 0; i < cache->assoc; i++) { + for (i = 0; i < cache->num_sets; i++) { g_queue_free(cache->sets[i].fifo_queue); } }