From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=192.198.163.8 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796375613; b=hhH/PTQJckmfaxP/afm5qb6VTvYPoqgxgx61zQ/i7yl9vMmlgol7UOVc6LZOs1LGMYmS Ng8UilZpfKGrJRC+ov8NhLXS07muP3ImDXdRNdJfnEDBOB4gBkhRjSVPx3SxZtOnzLyCt SCm8Fdh8D4lG4H7VjDicWVhgPLb+phJ3ow0G5Xqn02tJC3g2WWEwn0IuzKiL0t0m04X65 O1mtwbpr03zW1pYE1J9/Ba09kLLSTIRrjQozh3/QmT+g0DIbRdWH4uYp6yBo/5OBMI61+ AbFQRtvxwOn0EhkH2BmuL0heYYIvoytqXpU6FjBWL5LpHFtQAz1WGXk8/d5YIsDXhvA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796375613; h=DMARC-Filter:DKIM-Signature:X-CSE-ConnectionGUID:X-CSE-MsgGUID: X-IronPort-AV:X-IronPort-AV:Received:X-CSE-ConnectionGUID: X-CSE-MsgGUID:X-ExtLoop1:X-IronPort-AV:Received:Date:From:To:Cc: Subject:Message-ID:References:MIME-Version:Content-Type: Content-Disposition:In-Reply-To:Organization; bh=OZPl45lJbfkvra+GgcU9bcH0wGxppHdCb1C83WsB+TY=; b=jm0xNQDEo6zlxsFl9B2jgQ49Ap511hl7iyeKAMJ8pWFilw2c8FuShu7BqatOPFO87qJp k1ipkFNgnb2JQA2rrXIZNAFiVBDZltNlnGFjMiq5K5VZnSK59atCSjWtkQcCAMtTtibdv Sng64pBZjKkCjn7tdOOc+MtmhrBTchzXtQnDptDPpTnNtmjb8N5XkrCPj8O8mJeGK+H+4 KI3eYvWa1TXxkRz7ba5m2QkfNPvrNifDz9o+5D29Kj7fnIxmNEsd3qR58eQYNCmfKkMOC gdx3f3ioHfiQaKkGd3LWBtg62EZDH5YDPfUOCSml+5sHnpArnhZ29l/ZyG0gYHQX0SA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linux.intel.com; spf=pass smtp.mailfrom=linux.intel.com; dkim=pass header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=KolNPkJU; arc=none smtp.remote-ip=192.198.163.8 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.8]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2BA6E606A33A for ; Fri, 4 Dec 2026 09:13:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 2BA6E606A33A Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=KolNPkJU DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1796375613; x=1827911613; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=OZPl45lJbfkvra+GgcU9bcH0wGxppHdCb1C83WsB+TY=; b=KolNPkJUmfAz6CTzDMTjCB+n9HaucXCihBqDE42BWK1XFq2o09fajSwq qGD/R6DcU75hRCptg4Y0bQE3ebdNbtnCRwdzkjeFLaBjL2mmo0TjeMqX8 hhOYUI8XWm2kbmjXitNhx2SI2HcpqLrdKf4PoNnLc7ipdW5OEK6Pk4JFF rXh0dzDQbjK+qUjEz7uHEZu0Tj93MJs+BtXYVTpRLvhKnEFti3FWwrbYm k8F2UCe1ps/28CKf8trLvaU2IyKnWbngVO9IMzGccGlFg1tya1IhouPfN 24v6HxjYPQY13/SP7maiA+1W7QnTeMY0cII8BZTSE6StjbalLZaPEGcAT A==; X-CSE-ConnectionGUID: 1a+MHE1CTIuigeNJmoeJ/w== X-CSE-MsgGUID: 5UcpHrMqS8693OgeiPZN8g== X-IronPort-AV: E=McAfee;i="6800,10657,11985"; a="5236712" X-IronPort-AV: E=Sophos;i="6.29,78,1794902400"; d="scan'208";a="5236712" Received: from fmviesa010.fm.intel.com ([10.60.135.150]) by fmvoesa102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Dec 2026 01:13:33 -0800 X-CSE-ConnectionGUID: wKLBip4HTa6vD17p6OlyTg== X-CSE-MsgGUID: UMveAFQ+RHmCISTaP8Ob8Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.29,78,1794902400"; d="scan'208";a="14609270" Received: from alekseim-mobl.ger.corp.intel.com (HELO localhost) ([10.245.245.10]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Dec 2026 01:13:31 -0800 Date: Fri, 4 Dec 2026 11:13:28 +0200 From: Andy Shevchenko To: Eric Yun Lin Chiang Cc: Greg Kroah-Hartman , "Rafael J . Wysocki" , Danilo Krummrich , Johan Hovold , Bartosz Golaszewski , driver-core@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH] devres: update node debug info on in-place devm_krealloc() Message-ID: References: <20261203005704.3066960-1-ericyunlinchiang@gmail.com> <20261204003919.2280818-1-ericyunlinchiang@gmail.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20261204003919.2280818-1-ericyunlinchiang@gmail.com> Organization: Intel Finland Oy - BIC 0357606-4 - c/o Alberga Business Park, 6 krs, Bertel Jungin Aukio 5, 02600 Espoo On Fri, Dec 04, 2026 at 08:39:19AM +0800, Eric Yun Lin Chiang wrote: > On Thu, Dec 03, 2026 at 01:42:35PM +0200, Andy Shevchenko wrote: > > Do we really support shrinking for realloc() in kernel? > > I am under the impression that we don't, so in such a case info should > > not be updated. Please, check this and confirm. > > devm_krealloc() accepts a smaller size and returns the same pointer, > like krealloc() does, but no memory is given back. My changelog said > "shrunk", which made it sound otherwise. > > The patch only changes the size recorded in the node's debug info, so > on its own it only changes debug output, which is not much of a reason. > I wrote it as groundwork for letting KASAN check devres allocations > against the requested size rather than the rounded-up bucket, and I > should not have sent it without that context. Please consider this one > withdrawn. I will come back with the KASAN part as one RFC series, > together with a concrete case it catches. Doesn't matter. We should not lie to the users of the traces. If size was not shrunk, it is not changed based on what the caller of krealloc() asked for. If you want to add that to the trace, it should be an additional field or so, not the lie. OTOH you can introduce memory shrinking support to krealloc() but I have no idea what will be a perception of any of these approaches. -- With Best Regards, Andy Shevchenko