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 1A9BF8015C for ; Mon, 14 Sep 2026 09:37:17 +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 68E9ZxRt028400; Mon, 14 Sep 2026 12:36:00 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 68E9ZxRt028400 Authentication-Results: mail.openvz.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=virtuozzo.com header.i=@virtuozzo.com header.b="M2pywmPP" 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 68E9ZvAj028392 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=FAIL) for ; Mon, 14 Sep 2026 12:35:57 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 68E9ZvAj028392 Received: by mail-wr1-f70.google.com with SMTP id ffacd0b85a97d-48597bbd963so2502148f8f.2 for ; Mon, 14 Sep 2026 02:35:57 -0700 (PDT) X-Gm-Message-State: AFuF++m1YVWittkRYSOwBAsputg8fVIJLXgRYo8ufqpC4t9VYojrI675 6bo4mfrlaRe8nKhNEawjdAvePu65IBHLqMhvuGaY1LFh9gn4zcMfQW7LpVu43wMN7TlKttLshMT V7E6YNQviwZu1Fp1aGMZSS6ssn2CJMx99dxxNINVJEp8cxl0ReKS/0A== X-Gm-Gg: AYBFou1tjrRqt1ECYP3VHiT71CyVi3kXm3KIasajxPFfYn0cUwC0JK/2VBXFRR3gVDw 1IDmg3c+tlQ2e4ywf2BhwnUs8bzscIFwkcYums/Fy58vLJqJerxEtFnIA9Ce6dvHYDmJoSAPJP+ tUnYaFfmIfKVDr1STczSgCYDYcDGJqrbiVYibO9+AE68FeOUbODYeZSqalPzQBbkIdIVNGcdT06 9VOinEQI+JKr8Dm9RZ5SyhZo1bmVKDcHZSwiXAUkEp3smOKmBwFQEog+8GxhVqiggNo+/IvvxJU 7i2PnSsyK2fj5tZ+aVMNNqhSoo38IAqjM+2hFA89x8b5lwuV/m8MOdVU1pfaE+W92cHrx/08ZwY +Zgf2ulsvLARnFvPWhEw5/tb3wrT4Sg== X-Received: by 2002:a05:6000:4811:b0:482:f61c:7cdd with SMTP id ffacd0b85a97d-48702aaccd7mr3943021f8f.4.1789378557352; Mon, 14 Sep 2026 02:35:57 -0700 (PDT) X-Received: by 2002:a05:6000:4811:b0:482:f61c:7cdd with SMTP id ffacd0b85a97d-48702aaccd7mr3942867f8f.4.1789378556522; Mon, 14 Sep 2026 02:35:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1789378556; cv=none; d=google.com; s=arc-20260327; b=OqW/Hqp5fOKPB5SmijdZZ6cyuTzKH617usZ1QMZCizfylDtv0k+xhOW1HCI6hkdCUJ 0FFg2EjKbQU/Ba2kwT6Qn8JLrD3zfdlzCUJwts+8vGOB0lAZaLMon1u08BbvtWzBIzgT fAuDenH7iQMdicKoV7WUkrn+UpTxFgJDJV0l+SrdugfHNmQcNsmDzx9igfEQz0x4ZfXY wArYCa6jKQVvwqpQXqkzS8mUI6zKNnnQvNIR9miJaMzmKPkiN8Mcuvyi1JlpgQpsxPNH TvrndjXn65E6+F2Hpp+xLtnlWrwYprbDrrvMK+YGOh1nhAXUUfA1lJ2Kf3n6cJvKG56C GARA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=message-id:date:references:in-reply-to:cc:to:from:subject :content-transfer-encoding:mime-version:dkim-signature; bh=kct1z6B/xX0xVnJCYtkr3f+ukwZgdMKJTs+Rf/dCUww=; fh=skezItRrPUmDWFjzm5RAGnCYsXdZjhBsZcOEYn6bEzI=; b=To1sPGpr8LbaxmB4yraaZdYm1KxvI7QITIGI30h9UR8PyE5jmgzYGQyhaUQDXOv6EK AJ5lDnmWj0pd/T/WUYpV5KsH46/37zrUBZUsydyQoQr/C1Vd3D600ak/Nv1GB0MVnhVl MbhtTMsXi089ldWAlg/G5hBWRaZtnpI8NZ42YeTIXgakfrotPJdGw5TzGzQLs7mnmIIS 3GRH39vuqIqYlXSkntQ97kwybv7UVZBjEOUS3dmUnLJyJVV9eN5oI/yPvWGg0Kx/vKJh 0wYwVyVUKpvQkQQ9BRbpk93B9aaGVf+i68BdaZtjDws1itboLya0w2cj0YwUtOayL29d XSwA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b=M2pywmPP; spf=pass (google.com: domain of vasileios.almpanis@virtuozzo.com designates 130.117.225.111 as permitted sender) smtp.mailfrom=vasileios.almpanis@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-486eba54b2bsi18484569f8f.283.2026.09.14.02.35.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Sep 2026 02:35:56 -0700 (PDT) Received-SPF: pass (google.com: domain of vasileios.almpanis@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=M2pywmPP; spf=pass (google.com: domain of vasileios.almpanis@virtuozzo.com designates 130.117.225.111 as permitted sender) smtp.mailfrom=vasileios.almpanis@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:Date:From:Subject:Content-Type: MIME-Version; bh=kct1z6B/xX0xVnJCYtkr3f+ukwZgdMKJTs+Rf/dCUww=; b=M2pywmPP/zuq fDkAZ6TVzydV9xJJnhGr0fJtdu4dUuLN970xXOp1bCbE7XQtrQf/TwzSklwo7iVkvGbLq/Gbui2ls iMRx1KJ6gyRlq1dZI5GsdtEQhrl456nAZ5CLyk2mRu8bQbczLlbr7zKma/yPsWPvza/SfBwzYPzn7 jPKMl9SV2Pc0gBF2KP/bysJ2kVqgczwJoeokw+V0Q29xQqCakH4SPRVJ7w54/a+LMDhyzmeQ6YXxH eznmhPQCAD3JVIIu3Is3WIimb1WSVC+eN6YmQoj0pdACrx2oJLq+a+n7l44ujLhryS+KHGH0FSnDZ TwbRgXuKMRUWmXnlDQLWTg==; Received: from [130.117.225.5] (helo=dev010.ch-qa.vzint.dev) by relay.virtuozzo.com with esmtp (Exim 4.96) (envelope-from ) id 1x633k-00FEoj-2o; Mon, 14 Sep 2026 11:35:47 +0200 MIME-Version: 1.0 From: Vasileios Almpanis To: Vladimir Riabchun In-Reply-To: References: Date: Mon, 14 Sep 2026 09:35:54 +0000 Message-Id: <178937855430.982024.14476775263342989570.b4-review@b4> X-Mailer: b4 0.16.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1789378555; l=3474; i=vasileios.almpanis@virtuozzo.com; s=20260812; h=from:subject:message-id; bh=7wjcSnEaor4DP/pipyF2WQVvzYGYmhgjdj7KwMqskdU=; b=XVoEsjG0i6cM75ug7JRgh8wt2eutN6hk1D0BMVjrwZOlf4thtGB8tkPKMNOrIlvUysO28Nysr iVjs8PUZGD3BtC0KMN6LZTfxa22gpvU8eZJS7p6aFapJI1TN3f6E1F5 X-Developer-Key: i=vasileios.almpanis@virtuozzo.com; a=ed25519; pk=HhuHDXAcPva9A8zccWEMRsb36reu+y4IVbBjXKxNUjw= X-OZ-Fwd: true Cc: devel@openvz.org Subject: Re: [Devel] [PATCH VZ10 v8 6/7] ve: Introduce per-VE failcount 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 > It may be useful to have a history of resource limit hits for every VE, > this may simplify debugging and provide some information about the > resources usage. > > This information is provided by ve.failcount file, any write to it > resets all failcounts. > > To add a new failcounter we need to create a new atomic_t field > name_failcount in ve structure and add a new VE_FC_ENTRY in > ve_failcounts array. > > One change, unrelated to failcounts: aio fields are now initialized > in ve0. > > https://virtuozzo.atlassian.net/browse/VSTOR-135520 > > Feature: per-ve failcounters > Signed-off-by: Vladimir Riabchun > > diff --git a/fs/aio.c b/fs/aio.c > index cb63416af135..4ae06bcd47f2 100644 > --- a/fs/aio.c > +++ b/fs/aio.c > @@ -814,6 +814,7 @@ static struct kioctx *ioctx_alloc(unsigned nr_events) > spin_lock(&ve->aio_nr_lock); > if (ve->aio_nr + ctx->max_reqs > ve->aio_max_nr || > ve->aio_nr + ctx->max_reqs < ve->aio_nr) { > + ve_failcount_inc(ve, aio); > spin_unlock(&ve->aio_nr_lock); > err = -EAGAIN; > goto err_ctx; > diff --git a/fs/namespace.c b/fs/namespace.c > index 1d6e66cd7174..ea01664ff5f2 100644 > --- a/fs/namespace.c > +++ b/fs/namespace.c > @@ -3380,6 +3380,8 @@ static inline int ve_try_reserve_mount(struct ve_struct *ve) > > if (ret) > get_ve(ve); > + else > + ve_failcount_inc(ve, mnt); > return ret; > } > > diff --git a/include/linux/ve.h b/include/linux/ve.h > index fabc608e31f5..065129b42768 100644 > --- a/include/linux/ve.h > +++ b/include/linux/ve.h > @@ -80,12 +80,15 @@ struct ve_struct { > struct kmapset_key proc_perms_key; > > atomic_t netns_avail_nr; > + atomic_t netns_failcount; > int netns_max_nr; > > atomic_t netif_avail_nr; > + atomic_t netif_failcount; > int netif_max_nr; > > atomic_t bpf_prog_avail_nr; > + atomic_t bpf_prog_failcount; > int bpf_prog_max_nr; > > atomic64_t _uevent_seqnum; > @@ -94,6 +97,7 @@ struct ve_struct { > > atomic_t arp_neigh_nr; > atomic_t nd_neigh_nr; > + atomic_t neigh_tbl_failcount; > unsigned long meminfo_val; > > /* > @@ -102,6 +106,7 @@ struct ve_struct { > * other containers. > */ > atomic_t mnt_avail_nr; /* number of available VE mounts */ > + atomic_t mnt_failcount; > int mnt_max_nr; > > #ifdef CONFIG_COREDUMP > @@ -129,6 +134,7 @@ struct ve_struct { > spinlock_t aio_nr_lock; > unsigned long aio_nr; > unsigned long aio_max_nr; > + atomic_t aio_failcount; > #endif > struct vfsmount *devtmpfs_mnt; > }; > @@ -151,6 +157,16 @@ 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)); \ If this is called in softirq context for example like neigh_alloc it will print into ve of whatever task was just interrupted. So a random ve will receive this warning into its dmesg. I don't think this is good. -- Vasileios Almpanis _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel