From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: passt.top; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=QmSn76i1; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by passt.top (Postfix) with ESMTPS id 29F425A0262 for ; Sun, 29 Mar 2026 14:02:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1774785765; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=v04thoZ7C92y26hO6uCRMu5v4cvVXhHxcZ0r2VYIXeI=; b=QmSn76i13LIR+bkbzDfHzJnP3UY05XAB41TmFp8MLU2LPHm4++ZFRATzjKxl610T1civwj 3B6A27v+RfZyakbRQra2KQ5yn9sMlc4L31rfGG2wq879W4/GC+DHPrnTLI5FD/CK3KlWAa krXGquXjjdV4L8chjMIKRdCfJxRFZPk= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-688-WbCeq5EDMJWs1woapohqZA-1; Sun, 29 Mar 2026 08:02:43 -0400 X-MC-Unique: WbCeq5EDMJWs1woapohqZA-1 X-Mimecast-MFC-AGG-ID: WbCeq5EDMJWs1woapohqZA_1774785762 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-48534941525so52675915e9.2 for ; Sun, 29 Mar 2026 05:02:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774785762; x=1775390562; h=date:content-transfer-encoding:mime-version:organization:references :in-reply-to:message-id:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=v04thoZ7C92y26hO6uCRMu5v4cvVXhHxcZ0r2VYIXeI=; b=TVVEpQhX/nnOA5pZpHaqcD1msgVEfuljDzVFv5skBV0dOcva5KqXE3Vc7Nzix8/SNj fz20JHex8Qa/o6Cs1qeZkn9AoobEUemr9Zxjr3XJAq4uMdgEY5Q0nHZWqMJz324ajWpK 1guvx/jZb5jdxPN7h4fHlZR5+DmnB34JaPCTvhCPE3T8k7j40h9O1ALto6SvoQ+ObChr mVRxougvS5qfum+g4UIwp4H/sSNdH7v90yQfNRj/sz2CPTqImVA3mO7Pez1mKYlHgnNF nbPLWCd0t5V5/4siQRqmD16N4MMidUVqvu5eCkjZWnL8OToVVHC9/H2Sko03OTLzk84p eiJg== X-Gm-Message-State: AOJu0YxmiOyQzE6W7uu/eH4WnMhbZ9VMexZH5O3KumdIMOvqfWVCQJRi 2U215KVsbXp91AWjMYtgUxNkIjkPixkIjHMDGp1M8bUt/zwbo1NxV2kiy3NCsag9xWtAulR7R8f KCltbK8lrQpBhZPOgI5GHwO5UHpZn3YewEP39Pk6sYtG2U/0cytxdTOXd6IcyDgtS X-Gm-Gg: ATEYQzwlxczGj15nxYheRX0WzDkwENyLXBK/a0DjLnI/9Jl8KzqXSe8rbsILnxfhmuj u/nFLxLFME7IyIXx3FJKQM3zEljuNyZbfrah/BXBbaRdEQm12JXTwmKSMFcbEd3L/KTscFi18GU 2zgEXz+RKfMaUAoVUa1FCysI0KNdMQYkLQw6IMhH5M3IMd1Bdxabj4yRQKFZdXAcBoVly42hgQk PbeWh/R953O9l9wlaT3FtZXKVBCI379yiojrOo4R68Sxs3VBnD7S+EvQhkbKU0oiGb+a6AY4yNH dfNmUZgPe/yqtdpmTAoWZdD46DvArye+6vsFDwPiaHsCxYu4WyXZ8ZtMU0z33U9URXJy1JJXnZp S9nCyg1NR+k6iORhrHmky8ym+vt82H/Vdx6CB142ch0RFeFvgTw== X-Received: by 2002:a05:600c:4685:b0:485:3fa9:358c with SMTP id 5b1f17b1804b1-48727eeac8bmr156567665e9.17.1774785761730; Sun, 29 Mar 2026 05:02:41 -0700 (PDT) X-Received: by 2002:a05:600c:4685:b0:485:3fa9:358c with SMTP id 5b1f17b1804b1-48727eeac8bmr156567095e9.17.1774785761205; Sun, 29 Mar 2026 05:02:41 -0700 (PDT) Received: from maya.myfinge.rs (ifcgrfdd.trafficplex.cloud. [176.103.220.4]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48722d4d884sm284503195e9.15.2026.03.29.05.02.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Mar 2026 05:02:40 -0700 (PDT) From: Stefano Brivio To: Anshu Kumari Subject: Re: [PATCH v4] log: Add rate-limiting macros for log messages Message-ID: <20260329140239.6a7cce74@elisabeth> In-Reply-To: <20260326095019.387307-2-anskuma@redhat.com> References: <20260326095019.387307-2-anskuma@redhat.com> Organization: Red Hat X-Mailer: Claws Mail 4.2.0 (GTK 3.24.49; x86_64-pc-linux-gnu) MIME-Version: 1.0 Date: Sun, 29 Mar 2026 14:02:39 +0200 (CEST) X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: n-LpplrIGypDYSEQL3LW4s7-3xqEmGfo99IlamQgG_0_1774785762 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: FNKT6PL6XQOC64DSXRGYJN6MBSUJ2O5E X-Message-ID-Hash: FNKT6PL6XQOC64DSXRGYJN6MBSUJ2O5E X-MailFrom: sbrivio@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: passt-dev@passt.top, lvivier@redhat.com, david@gibson.dropbear.id.au X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Thu, 26 Mar 2026 15:20:20 +0530 Anshu Kumari wrote: > Currently, some log messages that would be useful at info or warn level > are kept at debug level because there is no way to throttle them, and a > guest could otherwise flood the host logs. > > Add a logmsg_ratelimit() macro that uses per-call-site static variables > to independently track each call site's rate. It allows up to > LOG_RATELIMIT_BURST (5) messages per LOG_RATELIMIT_INTERVAL (1 second) > window, then prints a suppression notice. When a new window opens and > messages were suppressed, the count is reported after the next allowed > message. > > Link: https://bugs.passt.top/show_bug.cgi?id=134 > Signed-off-by: Anshu Kumari Applied, thanks, and welcome to the git log! > --- > v4: > - Print suppression notice immediately after the last allowed message, > not on the next call, to avoid confusion with unrelated messages > in between. > - Add Link: tag before Signed-off-by By the way, you can also decide to leave the whole history (v2, v3) here. I actually find it a bit more convenient, but not everybody does. I guess it depends on how fast you re-post: if there are chances somebody missed your v3, then having the whole history is nicer for reviewers. You could also consider using git-publish for this: https://github.com/stefanha/git-publish I don't use it because of my own scripts and habits, but some others on this list certainly do. -- Stefano