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 1C3348017D for ; Fri, 2 Oct 2026 21:28:19 +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 692LR3fg026226; Sat, 3 Oct 2026 00:27:04 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 692LR3fg026226 Authentication-Results: mail.openvz.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=virtuozzo.com header.i=@virtuozzo.com header.b="syG3gPTi" Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 692LQj7D026182 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=FAIL) for ; Sat, 3 Oct 2026 00:26:46 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 692LQj7D026182 Received: by mail-wr1-f70.google.com with SMTP id ffacd0b85a97d-48b01a74792so202170f8f.0 for ; Fri, 02 Oct 2026 14:26:46 -0700 (PDT) X-Forwarded-Encrypted: i=2; AKwUvBz3S3A4zGdtKXOFkaIQrP+GN+aNaZ5vpcSN/VyvchOWu++9TvVeKQ+nikBky6LqtY3lrLoL6Q==@openvz.org X-Gm-Message-State: AFq9FYISCgz0yvVVGn/UO9Qfe+LhzO/REPaBeTU3EOV13el0yqEIa4HL S7yucLCg0PFt/qTAPH3YomYDZHrWq1T3Z+RnhJ/6G5APiNYTlV5JMhrzz9l8ygIVeeTAsoYYTV3 uMscZkjAoNyfK8sL9wfnHxTj4iwafotFCH7dyQn6+WwAodpQGKqMoSw== X-Gm-Gg: AYBFou1dHIR2OpA87I1jAkt+zdZdvqUJxEWJWwDDP+vXwYSlV64C4/Y3uF9qCHOHKz+ 8k97SMQPnRLEzIyJYiG+kw5UjerfFC8k6rICLtt1Iru0pX8QfzOaa+XdmUtOs1JDq2j6FnBI9gz x4QGzQobj/zdI3IMLeaRa+deqtg1t9fzmsVgvAVMzHk3gQtQJ/CLSoR1LMSx9CJIwhh613VW8Aa 1sMRV2iIQgRyJ+AmwMqpgfwtguzHuHZLWjQ0Fl8S8jX1zr2gzKKhHgQdFyPrOT/21Yp5YTAZ1TS 9YxxbhCm+LI5hFY1KTG6Eaopvg02Oer0Y2Ur1tjZj540InM+zbBxfzDrgF91NfYs+2uSWdamr/d aM0HHvcbgM8ekF24pwO7OwxyHvW2N X-Received: by 2002:a05:6000:605:b0:482:fd9c:3740 with SMTP id ffacd0b85a97d-48b12735845mr6243779f8f.22.1790976405678; Fri, 02 Oct 2026 14:26:45 -0700 (PDT) X-Received: by 2002:a05:6000:605:b0:482:fd9c:3740 with SMTP id ffacd0b85a97d-48b12735845mr6243748f8f.22.1790976404789; Fri, 02 Oct 2026 14:26:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1790976404; cv=none; d=google.com; s=arc-20260327; b=OEKs0k3lseVCEMbgaO/AVNxIoq2TZAI2ZidupGA1aqfpeO3eFgygeC+x6UCkn4iLE2 p1FsjRmaKFGhDave0NAoMoIuD81g64QUJovTfuw/9l0aw25MPoM4WGStEyWdHnYrN/+7 xNEca2/i14JHjlAxng1Y0k0c/qp5h9V2xcfl676ifWNWU0guOoPtsNEgPEYdaVRSdri8 RvllrjMMXXgC52C6/sWYH2JU+uRruhZ4oBMF/vrCfisWSFTxCWra9oRKn6/LmHs5tIBw CEr/oWleCTZ9d0E8BUUwyPyLpA0eDpLdcde0wRdMJFhXoM/5u5PX1GjVY+1ZV01DEkDe fUyg== 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=Cxp2PTrYnK/pFbc1ev+gScQgweHxL6XpldAjPCDnPx8=; fh=vUECVpjOjIdz431s8bRiKYBdScEDOVhPZlDu2AQ+txg=; b=fIBrLFVOhMnMQPBbNwurs2EJicdhNvBnWftXLWh4MtQOLyOWKIjr/XGiCDuVAhOh99 dLze++2P4Afk+da6uzj5F950XJCcMfmcZrxjK2Z5zvXNfhtIFZX3+LWnJWRw1HiEZsEH H3RDle5IJUFqWcWCgmv2d6efMZL/mS4vBw+rOcI7qcEyBCYHmEFL98PLLhQP23Bw8oLR SUeR1SsUWGtCN2dhUMTYUZXLpQZQW8/LYTAo8s9sBkTHxDJY3UtgaisAMwWYFvnohBXi 4vEgjGru6GOO14SPTMAXzviIMyYQFFXxQBIQAQTOYErFoMuaD4bhhJGl9q4DAE7S18He ZHUw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b=syG3gPTi; 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-48b5b4236bfsi6683453f8f.263.2026.10.02.14.26.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Oct 2026 14:26:44 -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=syG3gPTi; 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=Cxp2PTrYnK/pFbc1ev+gScQgweHxL6XpldAjPCDnPx8=; b=syG3gPTiCmNY1dJJKoX yzJHMjBxhY5HX3wxplx8cOQBim+PRu4Z1LmH0P352sD25nmVXEf9075+YWwbHMivHA4DFRAyNZ/bl Znns6WNHglXlfzWMhaipiRNQkKkl0J+o/ven4PBZq/Z5TAkt9aaltqQBm95EFkaffBYKim62BwPhu 5UXREb5iQfZcUjkdYdgra/ZhR6T110n4fQyVVhs8EurPmttS5CanyDryXNoIQO073+t7GVqtzHxku p1A8ZkQWXpeQnf+E+pWbA2nV5EGNzfaReX1rkGH/6Fv2uG4XzuCzVAoyvRHoJDY8JRIuqLXH8NDbJ N1Srr/7vd2Dq+GA==; 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 1xCkj3-00GcBK-0r; Fri, 02 Oct 2026 23:26:40 +0200 From: Vladimir Riabchun Date: Fri, 02 Oct 2026 23:26:14 +0200 MIME-Version: 1.0 Message-Id: <20261002-ve-printk-irq-v1-5-cb55896d455c@virtuozzo.com> References: <20261002-ve-printk-irq-v1-0-cb55896d455c@virtuozzo.com> In-Reply-To: <20261002-ve-printk-irq-v1-0-cb55896d455c@virtuozzo.com> To: Konstantin Khorenko , vasileios.almpanis@virtuozzo.com X-Mailer: b4 0.14.3 X-OZ-Fwd: true Cc: devel@openvz.org Subject: [Devel] [PATCH hci-8.1 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 1478e47dc582..ce82623fb138 100644 --- a/include/linux/printk.h +++ b/include/linux/printk.h @@ -755,21 +755,28 @@ 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); \ \ - WARN_ON_ONCE((dst & VE_LOG) && !in_task()); \ - if (ve_ratelimit(dst, get_exec_env(), &_rs)) \ - ve_printk(dst, fmt, ##__VA_ARGS__); \ + if (ve_ratelimit(dst, ve, &_rs)) \ + __ve_printk(dst, ve, fmt, ##__VA_ARGS__); \ +}) + +#define ve_printk_ratelimited(dst, fmt, ...) \ +({ \ + WARN_ON_ONCE((dst & VE_LOG) && !in_task()); \ + __ve_printk_ratelimited(dst, get_exec_env(), 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, fmt, ...) \ + no_printk(fmt, ##__VA_ARGS__) #endif #define pr_emerg_ratelimited(fmt, ...) \ @@ -787,6 +794,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, ...) \ @@ -797,6 +805,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