From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=198.175.65.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796298160; b=McoGmjNiIP9lz7V4MlHE9lfGc6N/IPR1bOXUPWDRQk2Vg+gPlAhpUaCYfNsYIXdt0kXb O3oZ8jsimyE6+ekPpJrWfAGf2WTiVzoQPnYtoOMfrKWnwXEU82+xh/llRWQhcEoOSzYBY 89a9Jxs2DiUjoLGjQLwAd6RaIirr+1T7gw1kHXp+hgq6w93mZdtJgVs2FnFHLjynZuxrh Dp+TJFnXghfnNK/WVNdOCHRg9IGC/3qwA/0hbLMkfl+tFLk03LI3Iqflwax7DTDT5dVis BVuy2duUrbCmCt+pjj3ekxD85S2uQis+5w5rQYuDsxBj0oUxqvJAcceo0koXJEuycFA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796298160; 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=TLCftCRWWeliQF750+4bCuxcLxRwIIFyEovmsix+5Kg=; b=qh2p6pTsK4FOaA6/5ww+zDlDITfg8va7csZYpegaKqjTpvQGyi7iSJRInvlptBXgzYkv 8VINcnc958Bj/ajXTOMxrBL1BG2PHD8YTZIvPY7sHdKcRluuPgssRkFQB9XflNT69TUlE 4GBNf8Q2ASTb4FEcYMzXILBqPwAcF/0G1hMjEvMU97Xuo3SKBwqIofkhJQ21dmgCCO27Y 4FeDi7A8LD0x2jNFzk0rmusxJXguwC975M+W1gOhGEI1wsm93dRaIh5dmQGFwC83VvdeO f535YH+lELZ+xjIbX2mtVI5DYP+cWxbTuymChq+8u/DG/TIGo8Qk/+5euatjO/flqKQ== 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=jGQuuDdd; arc=none smtp.remote-ip=198.175.65.18 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.18]) (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 EDD53606A338 for ; Thu, 3 Dec 2026 11:42:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org EDD53606A338 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=jGQuuDdd DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1796298160; x=1827834160; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=TLCftCRWWeliQF750+4bCuxcLxRwIIFyEovmsix+5Kg=; b=jGQuuDddD0qbWBopS7+8q/V6n82VUZChj2siAb6nPeFPmGbsGcJNfnlb 47Xu7bZBb2LAZUmFD+4XCBchZYxGlfaXkCTB5Ex34bVvNm1YlcR2axrma TPmGCRm/v99tVSy974t5qZGaC1GzCFodOb40tf2s8GPwAsmcOgW8h2PY3 e/RcDC6hXSGTinChqMKF33Xl62Q1x2o+F2VNKGuuRlUTRCojYuBQT3ESE av4PDoqZPCBs9HT7yKjD9thTTxC91ahyIHikvohWcmsEj7k7DBoZ+nkcS 6fA6SXZJqU0CmLZVHwTmLdDeTZbMRVMb8NBIFXudH8OtaM6j9Q+A7ksvf Q==; X-CSE-ConnectionGUID: pgFa0fJFTJOrl1dMMMnWjA== X-CSE-MsgGUID: FU+GwawJR3SoLbMsR10ZXg== X-IronPort-AV: E=McAfee;i="6800,10657,11984"; a="5270681" X-IronPort-AV: E=Sophos;i="6.27,248,1787036400"; d="scan'208";a="5270681" Received: from fmviesa003.fm.intel.com ([10.60.135.143]) by orvoesa110.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Dec 2026 03:42:39 -0800 X-CSE-ConnectionGUID: IXxXyWmDTg+aq5K6PTKjGw== X-CSE-MsgGUID: 6aCAlpbhQRS4xdjE01ALyQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.27,248,1787036400"; d="scan'208";a="13994941" Received: from inaky-mobl1.amr.corp.intel.com (HELO localhost) ([10.245.244.115]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Dec 2026 03:42:38 -0800 Date: Thu, 3 Dec 2026 13:42:35 +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> 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: <20261203005704.3066960-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 Thu, Dec 03, 2026 at 08:57:04AM +0800, Eric Yun Lin Chiang wrote: > When the new size still fits in the existing allocation, > devm_krealloc() returns the old pointer without touching the node's > debug info, so the node keeps the size of the original request. > devres_log() and the devres_log tracepoint then report a stale size > for the resource: a buffer grown in place from 1000 to 1500 bytes, or > shrunk to 600 bytes, is still reported as 1000 bytes. 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. > Commit f813ec9e84b4 ("devres: fix missing node debug info in > devm_krealloc()") added the debug info for nodes newly allocated by > devm_krealloc(); do the same on the in-place path, so the recorded > size always matches the size the caller asked for. ... > /* > * If new size is smaller or equal to the actual number of bytes > - * allocated previously - just return the same pointer. > + * allocated previously - just update the node's debug info and > + * return the same pointer. > */ > - if (total_new_size <= total_old_size) > + if (total_new_size <= total_old_size) { > + devres_set_node_dbginfo(&container_of(ptr, struct devres, data)->node, > + "devm_krealloc_release", new_size); > return ptr; > + } If I'm right, this patch is bogus. -- With Best Regards, Andy Shevchenko