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=ZE3hfE3MrdWgnSMKqtgXtLv8GF7GfscqiFWJrxBifOrj/Okks7NzzXhjSZHp7Do0obje nmKB2DYXwfLJlxp+6ovp8oiEX4Rdqjy/fea0sozZfxyNg1HxWNRfhWovSIlnFlyX/uqiO gFa2royLRtS2VDO6fcxdRTuvSsHSJ10h48PyN0EGylr6tMHWl1GazV7Z4bNCgC+uXXEWS WFTjpVq9PzBITjghDpLyjZva6MNP6QMZxqjhb2CMMomp4egIw7rbOoXPICkQ9Lh85x7Fj s7PQ9esVVtoZU0V24XciTGOorxAgNv9tHavJqBdQwTwltFWxOVFt66/GsJ27T5MqWvQ== 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=2oYjHyLY5DS2SZBGpetHcFNxHS/gdBybJu02Mjv3kaNJH0HqPx2i7PvXUbz8JgW0jpxw kzwjHFT0qM5Bjt6cbVF/eo/r1JrDm5h2KNM7/77/6mnogdSO8X7v28GOfWhiwvQaSxmQT ZoPqrhcad6r6r5I2R4ZjoAr14mI3aK3kcl3YjfrgSafADR4y9DAOJew9xZOBKMKsn4ooF HsSV65WGyMBmLBihX26ECc8QqlihZAr/7NtYH2wbXXackf6TojVOYV/03l6Tv7INgLv0h rfjmLBl7fvdoX2oyFz+pJGle3RiqtbhANJsr5t8mnJF5GEO67I/YksKuHwQpOyJ4WSg== 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 2BA49606A339 for ; Fri, 4 Dec 2026 09:13:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 2BA49606A339 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: Z89IBgEAQq2Ep5ydG/dFPQ== X-CSE-MsgGUID: 9hAtb1QbRiCP0oNgZbcF6w== X-IronPort-AV: E=McAfee;i="6800,10657,11985"; a="5236715" X-IronPort-AV: E=Sophos;i="6.29,78,1794902400"; d="scan'208";a="5236715" 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: driver-core@lists.linux.dev 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