From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.openvz.org (unknown [69.168.225.77]) by lore.virtuozzo.com (Postfix) with ESMTPS id 7E7F1802A5 for ; Sun, 11 Oct 2026 22:54:22 +0000 (UTC) Received: from mail.openvz.org (localhost [127.0.0.1]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 69BMrDJ1009414; Mon, 12 Oct 2026 01:53:13 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 69BMrDJ1009414 Authentication-Results: mail.openvz.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=virtuozzo.com header.i=@virtuozzo.com header.b="RU/xnn88" Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 69BMqq2e009365 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=FAIL) for ; Mon, 12 Oct 2026 01:52:53 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 69BMqq2e009365 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-4a17b4c613fso6003275e9.2 for ; Sun, 11 Oct 2026 15:52:53 -0700 (PDT) X-Forwarded-Encrypted: i=2; AKwUvBwwFl/GE5No0rUwyYaK/q6GyHQy6rYpIKhm6abT+QxKUt23GnXHCj/xwBWOuPcOtv6CVYVGQQ==@openvz.org X-Gm-Message-State: AFq9FYKTBC/ZjDBGoR+aylw7T1QYJk265IKmYaaht2lVYWg/WvWY1gfn rggw4p1+tqgcNiiu9TWyUX416FT5qB8gsfzNaYu67i40iEOH9QPxHEXhlJczGTN3KFNDDnws3kn 8tDbpN0QLQo40Vym6+lpnVq/7ASWOLV1ORZiZjvHzRQEtqdi1mZJXDg== X-Gm-Gg: AYBFou2whN5X+1UhJuDOovxta/IQeyk0vrin904b1Eo8mh/dLxYXUOxaJPBlGVjGptT xNBK4AtpEfF02dETXfGHPZlPLV3jJdp/cRjPX/tVLADS1wpy+kH3lm37JNw4rHKPtcn1NVAlYzZ VW+VM57fpsyywItNk9WKJzoDguZc6Ra99kVLFjMs69h57KpMtoez9akXMTAfE+L++nw9kMdLLXf R8PXjTpDD7LJuJmhMSFMVkYzQFLwF06AfmGAbOKhfpiIy3ujMA5rR8D6WXsNruBYdO2X1qS9y3O ZysWMu14DusDIiNArXcN4Jaq1KeeR8xXEEU8pFvL4wYAvRvhctwijgeyZ3N98EP7Zbu2/Hj1kql LpyEfXt64eGNK/qit3iURzr7YrHntVQ== X-Received: by 2002:a05:600c:4fc1:b0:49d:2536:402e with SMTP id 5b1f17b1804b1-4a19a9cf1e6mr36103805e9.30.1791759172744; Sun, 11 Oct 2026 15:52:52 -0700 (PDT) X-Received: by 2002:a05:600c:4fc1:b0:49d:2536:402e with SMTP id 5b1f17b1804b1-4a19a9cf1e6mr36103645e9.30.1791759172169; Sun, 11 Oct 2026 15:52:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1791759172; cv=none; d=google.com; s=arc-20260327; b=EhhDi4jx+U9Z+c92W25lMDU0+xDWhe5NJBbyuyRdIZr9dfZBGWUIIza211B9/wuj1A hswRtBGbiJXuNFBU8WYXHCFgSvB5Sittd7ZVPlrnjwRXwwYRIp7zKJUxUSnYz2F/J3el C7x4/QuQRNY2A5XkTbXqB2dSGuovF2Yg4h2mrubQ10kpZL1IQA79NDEQPDZvAVhogFb8 grGHRxkeDyqhq0aJ+DeM4DDF0N/KAmFHnJy4ZD2N0ZUfptMsTyxSUQ4qaSFTnxvja03o VQQG2rT6mDdh3odGl+bRdjlwVL8Vo+CIvkFUX68zfUWzuX9q56yMvdrPQe96lQ94oPte E3Lg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:dkim-signature; bh=gppfjVpDeyy1omjnDSmiF2m3AJKRRskkXOi+95+2XwU=; fh=eCOFrBZAqsL6jjT8ApulcBPCLrgIlXlNCEpSn7Ap5O8=; b=rRVUavSm4uKuBR+QbVxC/nDq3igByXGUY1apW6S8sQkpszfoja8O0AmnY8lLq4rEKO cJlZ1+Es5qkLqdAOoDztp5TPWfkKkbfb6Bgxbj6IZQhYdVnWy0+1yedEThsL3+IeXJfH BbyqfQ538Hoq9Abe3MRp7c5VozCJauW3T28fF7uApMT7cplNO1OFNG+HAHZenZhXLS0C kRh4RKAM932RjUM2GVd4oWkOZzI1l3WVLGEB0XPUe6J7WlSwq+I1LxF0O72tssp2B57a W5nd/Q3e/aGJsilXiS6/dDe+r5qHNcNC3esp7in+OlDPodQS4OwDS2yJev/Pr7XvcyZ4 V8+A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b="RU/xnn88"; spf=pass (google.com: domain of vladimir.riabchun@virtuozzo.com designates 130.117.225.111 as permitted sender) smtp.mailfrom=vladimir.riabchun@virtuozzo.com; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=virtuozzo.com Received: from relay.virtuozzo.com (relay.virtuozzo.com. [130.117.225.111]) by mx.google.com with ESMTPS id ffacd0b85a97d-48db9b07a82si14650575f8f.434.2026.10.11.15.52.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 11 Oct 2026 15:52:52 -0700 (PDT) Received-SPF: pass (google.com: domain of vladimir.riabchun@virtuozzo.com designates 130.117.225.111 as permitted sender) client-ip=130.117.225.111; Authentication-Results: mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b="RU/xnn88"; spf=pass (google.com: domain of vladimir.riabchun@virtuozzo.com designates 130.117.225.111 as permitted sender) smtp.mailfrom=vladimir.riabchun@virtuozzo.com; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=virtuozzo.com DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=virtuozzo.com; s=relay; h=Message-Id:Content-Type:MIME-Version:Subject:Date :From; bh=gppfjVpDeyy1omjnDSmiF2m3AJKRRskkXOi+95+2XwU=; b=RU/xnn88N4jeCeyZR2G S5DK+lRR2OWPFbddsDSvCQ3yX3srzQyi+qSGCRP2WRlN2VKLgSv810ESg2fTQDePQ8Ed9ZQKdBYmI bV28kobTeAihxpeqR7F1TEH6MtBwhgQgXLWyvv2dpQ0a2MQZIiCTA5RclpC2AUt0BwtLYBAheENSL ZcOXoJs0aRQqofV7QasIGDAkimiIdyqUbDuO7S10Y+rU5iszUIxJUG5Q2/KVS91robkOiiRg0nvEh J+39a7fVxhHR69igkTBqrcPBQH5enOnEC7mdtYu4/ypdFCeiqEWshtzBYwpgu6qvTxcfb9tsttvA5 e+Xmf9mO2NN3d0w==; Received: from ch-demo-asa.virtuozzo.com ([130.117.225.8] helo=192.168.1.87) by relay.virtuozzo.com with esmtps (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1xG2M6-002SCD-2a; Mon, 12 Oct 2026 00:52:44 +0200 From: Vladimir Riabchun Date: Mon, 12 Oct 2026 00:52:32 +0200 MIME-Version: 1.0 Message-Id: <20261012-ve-printk-irq-v3-5-efc95fd5c78a@virtuozzo.com> References: <20261012-ve-printk-irq-v3-0-efc95fd5c78a@virtuozzo.com> In-Reply-To: <20261012-ve-printk-irq-v3-0-efc95fd5c78a@virtuozzo.com> To: vasileios.almpanis@virtuozzo.com, ptikhomirov@virtuozzo.com, Konstantin Khorenko X-Mailer: b4 0.14.3 X-OZ-Fwd: true Cc: devel@openvz.org Subject: [Devel] [PATCH hci-8.1 v3 5/6] ve/failcount: Use ve_printk with specified ve X-BeenThere: devel@openvz.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: OpenVZ development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: devel-bounces@openvz.org Errors-To: devel-bounces@openvz.org ve_failcount_inc could be called from IRQ context, and we want the message to go to the right place. Use new __ve_printk helpers for this. https://virtuozzo.atlassian.net/browse/VSTOR-146839 Feature: ve printk Signed-off-by: Vladimir Riabchun --- include/linux/printk.h | 18 ++++++++++++++---- include/linux/ve.h | 16 ++++++++-------- 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/include/linux/printk.h b/include/linux/printk.h index 8428ad64ffa0..e15087a25918 100644 --- a/include/linux/printk.h +++ b/include/linux/printk.h @@ -754,24 +754,31 @@ struct pi_entry { printk(fmt, ##__VA_ARGS__); \ }) -#define ve_printk_ratelimited(dst, fmt, ...) \ +#define __ve_printk_ratelimited(dst, ve, fmt, ...) \ ({ \ static DEFINE_RATELIMIT_STATE(_rs, \ DEFAULT_RATELIMIT_INTERVAL, \ DEFAULT_RATELIMIT_BURST); \ + \ + if (ve_ratelimit(dst, ve, &_rs)) \ + __ve_printk(dst, ve, fmt, ##__VA_ARGS__); \ +}) + +#define ve_printk_ratelimited(dst, fmt, ...) \ +({ \ struct ve_struct *__ve = get_exec_env(); \ \ if (WARN_ON_ONCE((dst & VE_LOG) && !in_task())) \ __ve = get_ve0(); \ - \ - if (ve_ratelimit(dst, __ve, &_rs)) \ - ve_printk(dst, fmt, ##__VA_ARGS__); \ + __ve_printk_ratelimited(dst, __ve, fmt, ##__VA_ARGS__); \ }) #else #define printk_ratelimited(fmt, ...) \ no_printk(fmt, ##__VA_ARGS__) #define ve_printk_ratelimited(dst, fmt, ...) \ no_printk(fmt, ##__VA_ARGS__) +#define __ve_printk_ratelimited(dst, ve, fmt, ...) \ + no_printk(fmt, ##__VA_ARGS__) #endif #define pr_emerg_ratelimited(fmt, ...) \ @@ -789,6 +796,7 @@ struct pi_entry { #define pr_info_ratelimited(fmt, ...) \ printk_ratelimited(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) /* no pr_cont_ratelimited, don't do that... */ + #define ve_pr_emerg_ratelimited(dst, fmt, ...) \ ve_printk_ratelimited(dst, KERN_EMERG pr_fmt(fmt), ##__VA_ARGS__) #define ve_pr_alert_ratelimited(dst, fmt, ...) \ @@ -799,6 +807,8 @@ struct pi_entry { ve_printk_ratelimited(dst, KERN_ERR pr_fmt(fmt), ##__VA_ARGS__) #define ve_pr_warn_ratelimited(dst, fmt, ...) \ ve_printk_ratelimited(dst, KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__) +#define __ve_pr_warn_ratelimited(dst, ve, fmt, ...) \ + __ve_printk_ratelimited(dst, ve, KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__) #define ve_pr_notice_ratelimited(dst, fmt, ...) \ ve_printk_ratelimited(dst, KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__) #define ve_pr_info_ratelimited(dst, fmt, ...) \ diff --git a/include/linux/ve.h b/include/linux/ve.h index a400d21593b2..946df4eebe89 100644 --- a/include/linux/ve.h +++ b/include/linux/ve.h @@ -156,14 +156,14 @@ extern int nr_ve; #define BPF_PROG_MAX_NR_DEFAULT 256 /* number of loaded BPF progs per-VE */ #define MNT_MAX_NR_DEFAULT 4096 /* number of mounts per-VE */ -#define ve_failcount_inc(ve, name) \ -do { \ - struct ve_struct *__ve = (ve); \ - \ - atomic_inc(&__ve->name##_failcount); \ - ve_pr_warn_ratelimited(VE_LOG_BOTH, "CT%s: hits the " #name \ - " limit, see the '" #name "' counter in ve.failcount " \ - "of the container's ve cgroup\n", ve_name(__ve)); \ +#define ve_failcount_inc(ve, name) \ +do { \ + struct ve_struct *__ve = (ve); \ + \ + atomic_inc(&__ve->name##_failcount); \ + __ve_pr_warn_ratelimited(VE_LOG_BOTH, __ve, "CT%s: hits the " #name \ + " limit, see the '" #name "' counter in ve.failcount " \ + "of the container's ve cgroup\n", ve_name(__ve)); \ } while (0) #ifdef CONFIG_VE -- 2.52.0 _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel