Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp2035017rdb; Sun, 4 Feb 2024 11:47:20 -0800 (PST) X-Google-Smtp-Source: AGHT+IHe1RPfKvsh+GyCrAdmikunawr7qngt567RHruiguDcYgVCAGCaNJ5yCnVPwuk+hEMx9Olg X-Received: by 2002:a05:6808:2d0:b0:3bd:be7d:b751 with SMTP id a16-20020a05680802d000b003bdbe7db751mr13764826oid.20.1707076040567; Sun, 04 Feb 2024 11:47:20 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707076040; cv=pass; d=google.com; s=arc-20160816; b=nsQvLRdrHxkFPFt2bxJM2gJdnSd4RG/wB0UuDVujWzbSLT3dNGuCwSYsGjEXdwz9W5 bIxjK8xzVOw9uEVTafhWdH0jGWH3/qu5HptDBDEVEGtp2Vhn7emIDxCMAYCC6hqHJ47M EZO9tYwx2+QQcb4zAlh1r6Oow2tPI5ySkti0OPyBjKKZfZOtIpdiXWLjUmxED0v2ogOo 2llrsOlqHFyMnMBvxutuMBXVAg3kDZWM/EnSM/yVNesuVbIcX8vLMfZ8+pfBh4/hMJYF /s/zq3iolu+mVbTL3IZQsNzS6ftjmgfuemf3WA21JTcYgsTcqtZB5biVb7ZY/yhg4hpR WY1g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=5xfuEOvNkpMrvgeaTj0gZfx3Z6HaCNzQxxz5WJ1g3Tk=; fh=nrFPp6mqV8eQ1WDp97YkMToTFT2M7w+3EZEm8x63lII=; b=Yw7kXv2l1bjR1KcZ31+XItlW5NXKQ8BHjH0rYqj9Rpt9WqaXBpBB8/dihWEdoN+Ojs Xu4BVjPo5uatX61p/MQincKGghZsEF+ZWHpjKSCWxgNOW4FpL27K3tpLwtaDJm+TvehN NqDsSdDsH9W/kVCdRTKdKhTiw0ueJKvvBER1Rd/3xXJB+SmN4m9jrAiRWZ6mB0LD1Fne H20qxI5tiCGKZPuaPJctHG/li3dyqRyLPXqEj/vXtT8OEwvPJL1yK1YW2peVmHCyXOYW 2COawOTUsDszav1QmeS7ro8yz0hgAe5kyhwrngORt4O3MzwXeSKX1bpeVk3LWFkOtK7w 72uA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=HqRbpNgg; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-51859-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-51859-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com X-Forwarded-Encrypted: i=1; AJvYcCVZcSFPHK9jwYGul2gL3Ao4I781kKO8LIhExKyYAcogijbBYuj62+6kZbPrXRYgyTgExZHxKDsUaGovTChHoXjBivNrgk2wgMw4PUYLWA== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id j25-20020a05620a001900b00783f409e769si6911191qki.751.2024.02.04.11.47.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Feb 2024 11:47:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-51859-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=HqRbpNgg; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-51859-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-51859-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 11BC41C217E1 for ; Sun, 4 Feb 2024 19:47:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 50FAF2556C; Sun, 4 Feb 2024 19:47:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="HqRbpNgg" Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DFB3A2555B for ; Sun, 4 Feb 2024 19:47:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707076033; cv=none; b=VcU9Iw96UODfh3CKOtyM2wgWtTVZui8qyMYHR8PBeJJQxWrVIDvUIlSFb3NffpmcRfZyuwOCPYRgOMjMRstGHYi5KZ/Yk6ooUi1aDVRd13xwQLLlBOQUhzyD8xeqG9KVqajwoXhn6fdFTrH0eUxFRZ9QX2qJyV5Hy0J9D/Qz6yo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707076033; c=relaxed/simple; bh=dh5aUZbxgC6lmdPp6g0ZVDbzAffH5qeyfeOaJ86xRak=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=uy3yohkrbYmGHoz7GQIzJQoj+hrm/Tg9wUFY4XqglMe7Rt+0/YPhtUriZ5wuw1UjNR0+D/RAiDnYzV9eme6bOGCxIjRG472RcSmyrORnsYeomcpgUC8VBYsQEZhNaMcrmsv6oFsuZKpuvpB0wcotqmYAxnxxNC12ZsPjSRSb5ww= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=HqRbpNgg; arc=none smtp.client-ip=209.85.128.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-40fd72f721dso5524755e9.0 for ; Sun, 04 Feb 2024 11:47:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707076030; x=1707680830; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=5xfuEOvNkpMrvgeaTj0gZfx3Z6HaCNzQxxz5WJ1g3Tk=; b=HqRbpNggDQMqf9g5C8RnkDXNCuFKYLaYLqZ1KohrLT8vURFRgFt4rm3IXxAGemz7Rl NVZG3/oOQM35m3YgBaV8F1xN0+DJiN0BGA1bkBwNn8FXEQpIWKBTMmU2We86Ww80tnVV 09UmtR7BFdpGSIDeVBo6n5Is9IacfIXTyQ37air2R6O3iOK7uHW0ArwUGgb/UsvsuzfW SmbScYgXtdhW1X8FeF9W3c2ga08jl2ayFZXVcHRQripqTdRPmx1JTWgjgXWX5UX/qIPG +aSAmTCi/gaVzaB9EpcPrKX3liYudvAiOUGwpZ32DizPwxzoo1w5/pCR3km742YZbfWc +T8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707076030; x=1707680830; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=5xfuEOvNkpMrvgeaTj0gZfx3Z6HaCNzQxxz5WJ1g3Tk=; b=KBiybln18ZBSq97eU28rPwgtHPaaZPX5zuNA2ZSPH45HyJdNRgMUWhstgMcAKTtn1N HjBUi6v1/52SytMdp9Av5l2YUTJDB58r+0rL/hSTW1DiUfwNtG3+nS830XrqSgQnJd0P 9oPwgv8FmPxKsQcDDQ47s/yVwZuC5xoBRZg6E376yKSHn442GT0dKpWcb6ODh2wLz1AA brB39KVyIu31OXSYJR1XxYnkyT43aJw+BI9AcZJ7nOa9o0MT6pV7uzHnGeY1Kej5qW1v 66yPTHZYztmL0fs8bYOwy3nwjueBwk9ft+zTMLVM6GR5r8MsLIn0KTjEiSgJrsHt8nxe kGNQ== X-Gm-Message-State: AOJu0YwhzwT/VqfWf1x1pCaATIJHDvsQuDngd9HGD5+SvyiEK9NIfs6F hraeaZgiLRvwl0FAY3lB9pC6l9hwN9JefCjn9AEd7zVi3x/vEmG6 X-Received: by 2002:a05:600c:3585:b0:40f:c234:1fcc with SMTP id p5-20020a05600c358500b0040fc2341fccmr3034205wmq.29.1707076029788; Sun, 04 Feb 2024 11:47:09 -0800 (PST) X-Forwarded-Encrypted: i=0; AJvYcCVWx8pZheC091wJB9SwKMVSGQhcbLv+vOnxpwSAwPWFBeOVfqwpVU5CORd/n6wfIYic/owsO/n4VC6E9yk2TkQyRXATn4YnveOM0auQskKUl+tZkijwTZCnMhUj0aGncXc5LcTzHRu8CHSupeux5MmX2TuOYypRQmTujGjCHkkdJ5VjO2zDcY3OiXZqdBDT6M8s8qEWsdPPq31DQsXRgclFohb7oMKRSfNwuVAaNmc+SxSu0RIUmZDvCUrdaaKZNHMPwCek81t3u7e7+Gx0k9+sL6w= Received: from localhost (host109-150-53-182.range109-150.btcentralplus.com. [109.150.53.182]) by smtp.gmail.com with ESMTPSA id p13-20020a05600c1d8d00b0040fb30f17e8sm6631270wms.38.2024.02.04.11.47.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Feb 2024 11:47:08 -0800 (PST) Date: Sun, 4 Feb 2024 19:44:55 +0000 From: Lorenzo Stoakes To: "Uladzislau Rezki (Sony)" Cc: linux-mm@kvack.org, Andrew Morton , LKML , Baoquan He , Christoph Hellwig , Matthew Wilcox , Dave Chinner , Oleksiy Avramchenko Subject: Re: [PATCH 1/1] mm: vmalloc: Add a scan area of VA only once Message-ID: References: <20240202190628.47806-1-urezki@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240202190628.47806-1-urezki@gmail.com> On Fri, Feb 02, 2024 at 08:06:28PM +0100, Uladzislau Rezki (Sony) wrote: > Invoke a kmemleak_scan_area() function only for newly allocated > objects to add a scan area within that object. There is no reason > to add a same scan area(pointer to beginning or inside the object) > several times. If a VA is obtained from the cache its scan area > has already been associated. > > Fixes: 7db166b4aa0d ("mm: vmalloc: offload free_vmap_area_lock lock") > Signed-off-by: Uladzislau Rezki (Sony) > --- > mm/vmalloc.c | 12 ++++++------ > 1 file changed, 6 insertions(+), 6 deletions(-) > > diff --git a/mm/vmalloc.c b/mm/vmalloc.c > index 449f45b0e474..25a8df497255 100644 > --- a/mm/vmalloc.c > +++ b/mm/vmalloc.c > @@ -1882,13 +1882,13 @@ static struct vmap_area *alloc_vmap_area(unsigned long size, > va = kmem_cache_alloc_node(vmap_area_cachep, gfp_mask, node); > if (unlikely(!va)) > return ERR_PTR(-ENOMEM); > - } > > - /* > - * Only scan the relevant parts containing pointers to other objects > - * to avoid false negatives. > - */ > - kmemleak_scan_area(&va->rb_node, SIZE_MAX, gfp_mask); > + /* > + * Only scan the relevant parts containing pointers to other objects > + * to avoid false negatives. > + */ > + kmemleak_scan_area(&va->rb_node, SIZE_MAX, gfp_mask); > + } > > retry: > if (addr == vend) { > -- > 2.39.2 > Looks good to me, feel free to add: Reviewed-by: Lorenzo Stoakes