From patchwork Thu Dec 3 15:41:50 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wenwen Fu X-Patchwork-Id: 107220 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.18814.1796317033824972388 for ; Thu, 03 Dec 2026 08:57:14 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@qualcomm.com header.s=qcppdkim1 header.b=NsYUJw8p; spf=permerror, err=parse error for token &{10 18 %{ir}.%{v}.%{d}.spf.has.pphosted.com}: invalid domain name (domain: qualcomm.com, ip: 205.220.180.131, mailfrom: wenwfu@qualcomm.com) Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6B3EtuCA2315407 for ; Thu, 3 Dec 2026 15:41:56 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:message-id:mime-version :subject:to; s=qcppdkim1; bh=jCsZ/vaRwY8yZFT7iv7SZ6H/FtueVXz/deB p+daL7Ec=; b=NsYUJw8py1P9pd0k/mUuMAZqjBEoCIQ7IZZY2JyQvzYGTGaict+ DN43nkAZ4di0qXiZ/cfs2hR/b5IJJwqPKmHhFIHHyyxjXcnzk9WIN6j51npWvKiJ w95VpRxwB6QDs3H2BMH23rgQvTgsOYinkgMy45b/Ct4zvf5yP5TTYg7uSAMdfGoj CSZO85xKRh/gceLnivJ9AMlA0w4PLhku5NiFDOeaZ8HusfNwd+k5FLmVH6zNTonK Ak8fHxsHQD5Bv+Q+CiJI/PjTlEM9WGX99HFLlQOIjUjd/pc2vJDUlxw+Gh65ZWRr 8GbYGu5Oa2EH2p54CrnsoqrPj1WZqjL9uOw== Received: from aptaippmta02.qualcomm.com (tpe-colo-wan-fw-bordernet.qualcomm.com [103.229.16.4]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4jb6dusbvd-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT) for ; Thu, 03 Dec 2026 15:41:55 +0000 (GMT) Received: from pps.filterd (aptaippmta02.qualcomm.com [127.0.0.1]) by APTAIPPMTA02.qualcomm.com (8.18.1.11/8.18.1.11) with ESMTP id 6B3FfrZ33717651; Thu, 3 Dec 2026 15:41:53 GMT Received: from wenwfu2-gv.qualcomm.com (smtphost-taiwan.qualcomm.com [10.249.136.33]) by APTAIPPMTA02.qualcomm.com (PPS) with ESMTPS id 6B3FfrHM3717611 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Thu, 03 Dec 2026 15:41:53 +0000 (GMT) Received: by wenwfu2-gv.qualcomm.com (Postfix, from userid 3975139) id E4BFA3F2; Thu, 3 Dec 2026 23:41:52 +0800 (CST) From: Wenwen Fu To: openembedded-devel@lists.openembedded.org Cc: Wenwen Fu Subject: [meta-oe][PATCH] zram: trigger udev after initializing swap Date: Thu, 3 Dec 2026 23:41:50 +0800 Message-ID: <20261203154150.1530040-1-wenwfu@qti.qualcomm.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-Proofpoint-Reinject: loops=2 maxloops=12 X-QCInternal: smtphost X-QCInternal: smtphost X-Proofpoint-GUID: gPSJu5U0C6i6eyPoydMNMwF8SCII3bIm X-Proofpoint-ORIG-GUID: gPSJu5U0C6i6eyPoydMNMwF8SCII3bIm X-Authority-Analysis: v=2.4 cv=ZsJ4uN7G c=1 sm=1 tr=0 ts=6b118dc3 cx=c_pps a=nuhDOHQX5FNHPW3J6Bj6AA==:117 a=nuhDOHQX5FNHPW3J6Bj6AA==:17 a=pUM-KoujPXoA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=rJkE3RaqiGZ5pbrm-msn:22 a=EUspDBNiAAAA:8 a=Z7_6aoLpncAiSz-8LikA:9 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMjAzMDA2MiBTYWx0ZWRfX1Om3GyQ0rh/J HaHrCGSYiLiY7hrse110KgWOwsWmFuwC/MMS4wyKKpPhC1BamyFZw37blr1YUb1fEFMEaZJ+YKI olNjIkadknmWuymqfVEptLkfhwSXmk3beXOj4yQEnKhEMnncJ9zs/jtx1taFFWuEpYyp0F68SyP 2IFqrQ5FHgTm6BNSQ7s3wsz7tevyNNuT0+waock9MS6/yl21p3TBpQ81rFv024nCB5oPr69QeyM gJiGGO1VloeSoLpGVlTpEIIociLj4LtFAF9KVR+eJ/lnu7h/7i+7J6jdgLky1gGTZpywvleLY1P nZtGq4iQkoGgSu0VXb7ZOENJbeenjZm4iDDiTNezyEwO1ft07ydbV+AGqV0CPHLdltFFYY0PmBt jFliF7j0cK8RoIkgcRrFGOU/xZNHTV7LoakEbOC7rwsqvaEERFoOeyUaokS/LGssj4FVrsoCmH3 SbtVx+5nHC5OLtwHDGg== X-Proofpoint-Spam-Info: AW1haW4tMjYxMjAzMDA2MiBTYWx0ZWRfX7akrY+2qTl3E iML4+hk1jQ2/CXjC2sM9iT1jvB6uwKs5lp6u2J5SHBY+EZhgaTEeXqldaWJ1JWVGwzegcWsT1AP TP7ltZ9cqHeFc2+OjmiKDF87GiXKu0E= X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.138,FMLib:17.12.100.49 definitions=2026-12-03_04,2026-12-03_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 phishscore=0 priorityscore=1501 impostorscore=0 suspectscore=0 spamscore=0 adultscore=0 malwarescore=0 bulkscore=0 clxscore=1011 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2611040001 definitions=main-2612030062 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by lin-tor-korg-lkml-alma10-1 with HTTPS for ; Thu, 03 Dec 2026 17:07:52 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-devel/message/133987 When zram is initialized before real-root coldplug, systemd may still wait for udev to discover the device before activating swap. The initial capacity change from zero does not emit a change event. Trigger one after zram-swap-init completes so udev can process the initialized device earlier. Ignore trigger failures to retain the coldplug fallback. On rb3gen2-core-kit, median times after real-root PID1 startup decreased from 2.66 s to 1.71 s for zram device readiness and from 2.68 s to 1.78 s for swap activation in alternating warm boots. AI-Generated: Uses Codex (GPT-6) Signed-off-by: Wenwen Fu --- meta-oe/recipes-extended/zram/zram/zram-swap.service | 2 ++ meta-oe/recipes-extended/zram/zram_0.2.bb | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) base-commit: 914fca8c896edcde152e8a77661840130bbcc517 diff --git a/meta-oe/recipes-extended/zram/zram/zram-swap.service b/meta-oe/recipes-extended/zram/zram/zram-swap.service index a4dc9514e6..502a560ab6 100644 --- a/meta-oe/recipes-extended/zram/zram/zram-swap.service +++ b/meta-oe/recipes-extended/zram/zram/zram-swap.service @@ -7,4 +7,6 @@ Type=oneshot RemainAfterExit=yes TimeoutStartSec=30sec ExecStart=@LIBEXECDIR@/zram-swap-init /dev/zram0 +# Trigger device discovery after the swap signature is written. +ExecStartPost=-@BASE_BINDIR@/udevadm trigger --action=change /sys/block/zram0 ExecStop=@LIBEXECDIR@/zram-swap-deinit /dev/zram0 diff --git a/meta-oe/recipes-extended/zram/zram_0.2.bb b/meta-oe/recipes-extended/zram/zram_0.2.bb index 2c894c0230..458d145bfa 100644 --- a/meta-oe/recipes-extended/zram/zram_0.2.bb +++ b/meta-oe/recipes-extended/zram/zram_0.2.bb @@ -5,7 +5,7 @@ LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda inherit update-rc.d systemd RDEPENDS:${PN} = "kmod util-linux-swaponoff \ - ${@bb.utils.contains('DISTRO_FEATURES','systemd','util-linux-zramctl','',d)}" + ${@bb.utils.contains('DISTRO_FEATURES','systemd','util-linux-zramctl udev','',d)}" RRECOMMENDS:${PN} = "kernel-module-zram" @@ -32,7 +32,8 @@ do_install () { install -m 0755 ${UNPACKDIR}/zram-swap-deinit ${D}${libexecdir} install -d ${D}${systemd_unitdir}/system install -m 0644 ${UNPACKDIR}/zram-swap.service ${D}${systemd_unitdir}/system/zram-swap.service - sed -i -e "s,@LIBEXECDIR@,${libexecdir},g" ${D}${systemd_unitdir}/system/zram-swap.service + sed -i -e "s,@LIBEXECDIR@,${libexecdir},g" \ + -e "s,@BASE_BINDIR@,${base_bindir},g" ${D}${systemd_unitdir}/system/zram-swap.service install -m 0644 ${UNPACKDIR}/dev-zram0.swap ${D}${systemd_unitdir}/system/dev-zram0.swap fi }