From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BCB2536308A for ; Mon, 1 Jun 2026 08:07:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780301279; cv=none; b=C5s+vw1MWNGJp8BY2Q1TvFiMibg/amRfqx8sdStlVC5+hbHJwdzyUEZLtZ6NgkKQMGuXbo2KzAGgvPCNN75ltjMGx99XltBbc/4/4sToLm03/XY8Pc4JTrxcSsYUIt4lL/hZ6j+JTlmw+Lzib9Ee9RZ0GutUGGOVY09KRDI20gU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780301279; c=relaxed/simple; bh=7rmNalGmd7Fwcj7GlFU39em2V1c7J5qnPQxFsrHv7Dg=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=Yvr53X0T0arYAKmB91SnGeuR5wi/Bt4yl+Kl89OCc/PafilA5rEsi9mWsorl6QgrOCOm/TO1AVOx9LBkBC7WPz4D9CIe6NsXudW6cY9E20mR9tCCDLtUmD1dRAywFDcYnQDwSyPPabhYyU8HCE/PeLdY4k/a+/NDNgP8q8hRbZ0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=GMFu8Emw; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=kStjXQwp; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="GMFu8Emw"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="kStjXQwp" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1780301276; 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=7rmNalGmd7Fwcj7GlFU39em2V1c7J5qnPQxFsrHv7Dg=; b=GMFu8EmwciKYyGT4bzRyV6cJhcirZwbSysKAvMdVcCOTyl+sZEeKAQsGQmfHrH7AAKWqx+ G1vxrr0gqufDP8uMOHv7JptKeSmIbDbXi3lAmr32XY8ifKvYtmYmKxibxb5LVuRsLNjSPk DD6Xzmb9AG3xH1XYXNtCvPCoYFauKhg= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-41-fuH1NhJtMe64j-XAcYILRA-1; Mon, 01 Jun 2026 04:07:55 -0400 X-MC-Unique: fuH1NhJtMe64j-XAcYILRA-1 X-Mimecast-MFC-AGG-ID: fuH1NhJtMe64j-XAcYILRA_1780301274 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-490a767b782so7794225e9.2 for ; Mon, 01 Jun 2026 01:07:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1780301274; x=1780906074; darn=vger.kernel.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=7rmNalGmd7Fwcj7GlFU39em2V1c7J5qnPQxFsrHv7Dg=; b=kStjXQwpqrnfrsKOKwSqfZGDDf65u/nw1A4uctVlxHmdxcxT8Dje72Y4fHRBQe0pMj aBf2EFAqeOtR/9gBT9MiDIZb53n7vSA1gUrcaMkc+s94J3lb92lGX/HdlOX7MJszc2Z1 kN+ABwQp968Mh/zkG8FK8fhHx1eBfYetQ+E8OCpur5EaREPChDqFpgjN7wYxu2hlbhUQ pd6CqgBa3zZD5or2lc0OVz2HXqfuL9tM/436Eq/qDrLQms+ziLh99CfdZKTULdVTkgrg yoQEr0Iqx/G2n4kxKZJy/eIUOv4oNn50jTvj+/yaqk1bSucDx3rAzIQVETuGcCRQzeZ3 goIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780301274; x=1780906074; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=7rmNalGmd7Fwcj7GlFU39em2V1c7J5qnPQxFsrHv7Dg=; b=Ed98Z3vfj7LnYQ+LL1KBSTJ9C6G+Dm7IV1/cjxn7UX61eK6mPsEM5XngQsRmFyH6J0 4Hhn+ahxZXfLgZSaBN5ultCoXc1KjHzI2l4wdoUh3GcPnkLNAhPk76EUov6rFH18A0BB JXLlQlBPWH/aGVCr26ye6B3nPluQsTVnU0lK5/oL6JaYZfrmqhrQ1JNZPdM8QoK0Hj+L IZCa0cf37ffb5WmDCHrdTQx24FRc1p+MOEyQMiv3mQWWOo69MTb1UA3sq30OB5EJX4Ne +Qd5vbj6cyyrBtqTPv8bb+0pW56YjAl8UzgzSAs+iyigXLE58IMbXp2KW0KojeZmnpyB Cr7Q== X-Forwarded-Encrypted: i=1; AFNElJ8CDVn8UuTIFF4j3Aiabpn9/I5drNSgE1sjZYfxCxWhl88+6CG7UG05k6kUyrW83+MRNuw/Ws+SDJ9gm2s=@vger.kernel.org X-Gm-Message-State: AOJu0Ywgh7ZTF4ukwam+lIoayV+qXHnmAqp66TpU/QpDH+OiNK2R7Bi6 TPzHV9tzwlQoF3OtDYNiKgY5BGmlNggEPuc4f/pJVV1FL1ICFZdyKH2f5KUjHe/qyigokp52gYk Wa6s2n1QP85TpwO93akAyhKUDg8qEadycAYrWi7OUVsoHK8Io6bCahTkaZyBc1SsFzw== X-Gm-Gg: Acq92OH8VAoXcJ1QTKXUYGGRc0+w5oaxSWYkHkv2L6vKM6YDT+HTAqjD38yFu6lwSTH lEl8Rn2xP+Sndo9UWBYEV3d2/m7x6ERF1zxU3Mdd7mO/+wOnWSRi8yF8GA+D/smL92BYZ+Hu6ON YCutJjma6i8JRhrEvRqVxBsv+8sJUfH7X0RU/6zkWpGKrsnHI5kS7KJBpSTofGwkHi0omc326T4 VNqcTdpCjcs68HMIB9q0URq45YfJNsHo/I1wo33a/SPsUM4M5NSyBCdAVNN68HHSH/B4/qXwrxT CJXe0ZlXY2KZK68jHbmHFrHwijyUk2k/hQnanh+PxjDPk+kcDIr4ExTCQrWevD9IXyX7awdPtFy mLS+h/UsNzRVnod6eNWiBEMuDKMz2dQwIaraz X-Received: by 2002:a05:600d:6413:20b0:490:890a:da46 with SMTP id 5b1f17b1804b1-490a292a4b7mr137676915e9.2.1780301273809; Mon, 01 Jun 2026 01:07:53 -0700 (PDT) X-Received: by 2002:a05:600d:6413:20b0:490:890a:da46 with SMTP id 5b1f17b1804b1-490a292a4b7mr137676275e9.2.1780301273459; Mon, 01 Jun 2026 01:07:53 -0700 (PDT) Received: from [192.168.1.167] ([185.168.96.228]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-45ef35874b7sm24054966f8f.35.2026.06.01.01.07.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Jun 2026 01:07:52 -0700 (PDT) Message-ID: <0de9778e529af5561336588c651b3a59c69a17ff.camel@redhat.com> Subject: Re: [PATCH v3 06/13] rv: Do not rely on clean monitor when initialising HA From: Gabriele Monaco To: Nam Cao Cc: Wen Yang , linux-kernel@vger.kernel.org, Steven Rostedt , Masami Hiramatsu , linux-trace-kernel@vger.kernel.org Date: Mon, 01 Jun 2026 10:07:52 +0200 In-Reply-To: <87a4teyavy.fsf@yellow.woof> References: <20260530141652.58084-1-gmonaco@redhat.com> <20260530141652.58084-7-gmonaco@redhat.com> <87fr36yb7g.fsf@yellow.woof> <87a4teyavy.fsf@yellow.woof> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.60.1 (3.60.1-1.fc44) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 On Mon, 2026-06-01 at 09:31 +0200, Nam Cao wrote: > Nam Cao writes: > > Gabriele Monaco writes: > > > +static bool ha_mon_initializing; > >=20 > > The global variable makes me a bit uncomfortable (a quick google > > will tell why this is not the best pattern). > >=20 > > I am sure there are better ways to differentiate when we are > > initializing vs destroying. How about the incomplete sketch below? > > I doubt it even builds, just give an idea. >=20 > Or instead of function pointer, we can also pass a bool flag whether > the timer should be reset. Good point, we could probably do a bit better than the current in separating initialisation and destruction/reaction. I'm going to have a thought. We are also protecting against tasks where the monitor never started, so they never got initialised before destruction. This makes it harder to distinguish. One thing to note is that we should probably keep the reset signature constant as that's a member in struct rv_monitor. But that's probably not a big issue. Thanks, Gabriele