Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp5473687pxv; Wed, 7 Jul 2021 04:45:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzlE/hDm+zCir0ua0E39msCmnV50/IZQHSsb2qa3KNolvKNOi2RtGrzqWDYIsxP8UuBj2Qc X-Received: by 2002:a02:a78b:: with SMTP id e11mr10254993jaj.32.1625658352205; Wed, 07 Jul 2021 04:45:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625658352; cv=none; d=google.com; s=arc-20160816; b=oRA9qK8i/UdqCjuqhT7ZuTyByVc2LSJeXPbGxLMVbh4+hrEVV9i/7PfWElB66VkyEa T3qZ3Jp0Tkf5G4Q9y7IwkNU4XU/UJqYqv9Aqoy/Mu1jZeD5yIXpZUoQHDX8StmL/6E77 4hhWzu1q+44EKQFzMDq6ssr8p+7dOyeqicAzlXYYJU3S7ytVZ7Kh8fD/uqwS6D4gAO+9 pKL5tjEriwtsZ6XJRTzm9lMk65SDQxtkfn6u7ioyQmewiuNCW7LOSOOKgT1sVuR6FsC3 8VUjKudpPxylQTq3oDjxddHN3X9+86DiWCRm/0uxhsr4Cjuz8kc+PyoInj3us1+2EAbQ Vi/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=zSY/q9amJOqIbQTwSD5jnwRuDs6SKtOJ+EYwUjO/PlU=; b=v4rTHvVkvw4bQkuOOov6DTB4mjwQIeqTvaqxJaKSVmsbWnJDM44BDjHa+8FXFBH7Ik mkprhLIDxhS8VkP9pClW29LGr518LcX8gmsKBa5n5m8M86aLyvMzUY1u23w/J/k75S4O dlzuBcNPQMhdHBWJ3XRmv4lWOWlJylQlIqmJ0Xsi+ENjDIYD87hxszrHN8LuDpq+6Q6W Ev3245MVDvfTfRd2SbUaDZ8EaxLBuxfEOaunadTun9REcOSxrH+o4fewSRWK4Ndn3FL1 J3Xgk2tL84tvg90FzCUx9DfnDU5XuUr0DvS0nsNBC/QQ8D8+hGSpPRaLcXuF3QDOvsjf 11ZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=cawyPc5I; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k9si24022418ilo.95.2021.07.07.04.45.39; Wed, 07 Jul 2021 04:45:52 -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=@infradead.org header.s=casper.20170209 header.b=cawyPc5I; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231391AbhGGLrZ (ORCPT + 99 others); Wed, 7 Jul 2021 07:47:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60030 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231358AbhGGLrZ (ORCPT ); Wed, 7 Jul 2021 07:47:25 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 06F39C061574; Wed, 7 Jul 2021 04:44:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=zSY/q9amJOqIbQTwSD5jnwRuDs6SKtOJ+EYwUjO/PlU=; b=cawyPc5IAWmVl4N2zPGHcAbfCS Isxrsovp5U5OJ1kzcBpOFpRMy9omtLh/7Vgt4CnEBIfi5fni3UCgViMDMd0aBM4nYRUnhrO524Fac UTzFfSaol3EZqgAuuMLibrfXtjfRroXUz92tnlvwDwwJhI1aE1zxj9+ZoXiED45Q1IvpUlU00aq61 LV7zp4Bh3HBZVvIpSmRAjSNo8jNCToa4sdHXB/4Mg+e0ldNVgV+9guRh3Q3YwwZeonLT1iuKoSUL1 sruBUjqWRgMpZ0RvAs+NeQ4+YnLjhFNSlZWLragrvoDuUR260nMbOpUQvfDOnv83nX4Qnx6+V4DZt 5n5C1Nrg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1m15yK-00CMIc-Ed; Wed, 07 Jul 2021 11:44:17 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id F051C300233; Wed, 7 Jul 2021 13:44:07 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id D71C0200D9D6C; Wed, 7 Jul 2021 13:44:07 +0200 (CEST) Date: Wed, 7 Jul 2021 13:44:07 +0200 From: Peter Zijlstra To: "Liang, Kan" Cc: alexander.antonov@linux.intel.com, linux-kernel@vger.kernel.org, x86@kernel.org, ak@linux.intel.com, stable@vger.kernel.org, alexey.v.bayduraev@linux.intel.com Subject: Re: [PATCH] perf/x86/intel/uncore: Fix IIO cleanup mapping procedure for SNR/ICX Message-ID: References: <20210706090723.41850-1-alexander.antonov@linux.intel.com> <3d634baf-8abe-480d-61ed-ade1945324ee@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3d634baf-8abe-480d-61ed-ade1945324ee@linux.intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 06, 2021 at 10:12:55AM -0400, Liang, Kan wrote: > > > On 7/6/2021 5:07 AM, alexander.antonov@linux.intel.com wrote: > > From: Alexander Antonov > > > > Cleanup mapping procedure for IIO PMU is needed to free memory which was > > allocated for topology data and for attributes in IIO mapping > > attribute_group. > > Current implementation of this procedure for Snowridge and Icelake Server > > platforms doesn't free allocated memory that can be a reason for memory > > leak issue. > > Fix the issue with IIO cleanup mapping procedure for these platforms > > to release allocated memory. > > > > Fixes: 10337e95e04c ("perf/x86/intel/uncore: Enable I/O stacks to IIO PMON mapping on ICX") > > > > Signed-off-by: Alexander Antonov > > The patch looks good to me. > > Reviewed-by: Kan Liang Thanks! --- Subject: perf/x86/intel/uncore: Fix IIO cleanup mapping procedure for SNR/ICX From: Alexander Antonov Date: Tue, 06 Jul 2021 12:07:23 +0300 From: Alexander Antonov skx_iio_cleanup_mapping() is re-used for snr and icx, but in those cases it fails to use the appropriate XXX_iio_mapping_group and as such fails to free previously allocated resources, leading to memory leaks. Fixes: 10337e95e04c ("perf/x86/intel/uncore: Enable I/O stacks to IIO PMON mapping on ICX") Signed-off-by: Alexander Antonov [peterz: Changelog] Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Kan Liang Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20210706090723.41850-1-alexander.antonov@linux.intel.com ---