From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 61D322DF144 for ; Mon, 1 Jun 2026 21:42:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780350129; cv=none; b=ZZFRXcKbpC9oVy328zqJZ/iUzE9bkEDbp7b7l0Fmz+7xro1JWH5eazWG1nFsS8FQNpV6JF/e0gHL0ninak40TyTOMKHCQo5bigjvcBX8Yvm413YY7VuD+0HHXkpZF8RdSxFd7LyXdaGbOJzx+2o4aKdKODeUr5dUVKj/fqM6510= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780350129; c=relaxed/simple; bh=PsKdNGEJ/GEbniw8+Esy9ECKjpaaqQIGonhyoIBGdU0=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=KqFiYmTSXjZ/rrdgt3jNwKbBTBr9Zpsng2fBZWtsm4nUnoGDPBBnfKuwskBsZqcwDZEyH3mKiSgGxgvhZD2TxU/yZYWMS5h7phQxGCj9tLptFpIP4+lGynL8mTH2Q993YfX0ZuXhZUkLJXjRc0M31MACpISLMvSl/3gmu2sRUJo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=m0j3Nyze; arc=none smtp.client-ip=209.85.128.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="m0j3Nyze" Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-49050bfe053so75115875e9.3 for ; Mon, 01 Jun 2026 14:42:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1780350125; x=1780954925; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=LQGOEh1bZHWnu9Uz0mQ1yk1YZrq6Rissv+4IeOd2hWk=; b=m0j3NyzeKJZWgxrErxSB7h7pH+5t979K8ZMKiy0t+iDQ5uoOZmII4BSr6OSLaKPwzT Q3G1V7CXVDVUR302w+jYayZZ81SF0/GdabZq2+svbs1QIWo5Uili7YhvSSIvGEBtfb5d D/eny2CteC3s1BMbpx19UGZ6OHPYHDovnlf+6oAR3OXikszm5Ep27Be6LfZXTBYUd5CG vHvyNJw8qzhTLxHriYlayc3hxu962eDdw90KIql4Xmfd2jr1ySQfAZ7ra+BO2Asvr553 5tqjAbYf4IdpQ+j4Ugfsp6xSdqftp+3G0x3BUPghtzkVhuyfEDxw9qspWCExeujd5aEz 556A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780350125; x=1780954925; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=LQGOEh1bZHWnu9Uz0mQ1yk1YZrq6Rissv+4IeOd2hWk=; b=kCPJ1OcR6LJTOdlp2WEHLwdDYxTVRKUqFhHGMxmu41ORp/iBakmG7grFqB3s8h5HvE 5/sWVa/7HGxUZkgFjZwbSRcB1D9jy/rVzgOVXSgJj+Uf4nISJzQCZ46gSiKvuHKRSz2u ueQMfHYNfeDOhqIX/x7+VQi2IfkTGfyhmphJrLHVjwrkxNHA4EwrJjcLtVwxdWw7LoSs r07ESiAooIBPC4TvRFbqLbT9JQSSAFoHLZhz9H0LWxe+LsxKyULemJEqpF8gGmh20nlF 6Z0oCrzOU50NTqi7gnIgIPIhTeD/+fcjuwzHXNNXNp2suwWxeQCKqmiyrY8XK2dvvmhE X2iQ== X-Forwarded-Encrypted: i=1; AFNElJ+ghHy5xr2CckUUXiL13VXYwPUgPEh5fFmfGLZQcLRXXcRQ219OWWP3uCiGISUN8eXxhxtNH3oB7twJtEw=@vger.kernel.org X-Gm-Message-State: AOJu0YzJVxuldA/f51nPHifbS8mDCiQSGYSTQS30yAza4eoUUNU1s7T6 o6baNGfP6gYm8/FR1kKkzh3jDG9VW8IZYnSP1GnqOIyIH/Zs9loC3TuT X-Gm-Gg: Acq92OGBm9y5I230yRq+Y8OzaBDrKM24j/UEVi+ORhhA/1+DGJx0mx/ZTbbKewt9MWH VHKWwZAwNYfufwS5f8RtEbZ1W+RyaGC2GagkiTGxEuz7hrrFfjKxdyZTXT3ZFM1ue2LWBvkWUqK /+wZR++jS9bf/DbaUuomNTDhqSblTKysJicgYJFuCXepRddTR8PGHhbvIQf4c077i260YRuY6m8 ziWHUBKGEaq3kq1tDGh620oYB9ehUcxMROX/k8QBGRKmnaDIPQLwBrNt+GnqUHUO2h6c9dx0Mc9 tZOCD5ny9G9qkuO/SVudKC1/711mfyzQCxZ4yKttOqVBtJYowjIs6hf2ROlCcvsfw32RwXOdJ5P sHAaBaAKNv/EW93AVPR+ep80JC1hqXkh0e7Z2IYkxle7njBTmyVnHkhDu//wsn/cEI4x5jGURda QMhKOFULMTJcYLcmH/I0YRH4Xr/Vlna+8aJZ/q9EWHkSEqkeIhECg3PDyBPYxoWG9BlnIUwZM= X-Received: by 2002:a05:600c:4f0f:b0:490:482c:437e with SMTP id 5b1f17b1804b1-490b08872a6mr31969755e9.23.1780350124761; Mon, 01 Jun 2026 14:42:04 -0700 (PDT) Received: from pumpkin (82-69-66-36.dsl.in-addr.zen.co.uk. [82.69.66.36]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-490b0e0f343sm20188985e9.1.2026.06.01.14.42.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Jun 2026 14:42:04 -0700 (PDT) Date: Mon, 1 Jun 2026 22:42:03 +0100 From: David Laight To: Alexander Lobakin Cc: Justin Lai , , , , , , , , , , Subject: Re: [PATCH] rtase: Avoid sleeping in get_stats64() Message-ID: <20260601224203.5d282c21@pumpkin> In-Reply-To: References: <20260601062447.64027-1-justinlai0215@realtek.com> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; arm-unknown-linux-gnueabihf) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Mon, 1 Jun 2026 15:14:50 +0200 Alexander Lobakin wrote: > From: Justin Lai > Date: Mon, 1 Jun 2026 14:24:47 +0800 > > > The .ndo_get_stats64 callback must not sleep because it can be > > called when reading /proc/net/dev. > > > > rtase_get_stats64() calls rtase_dump_tally_counter(), which polls > > the tally counter dump bit with read_poll_timeout(). This may > > sleep while waiting for the hardware counter dump to complete. > > > > Use read_poll_timeout_atomic() instead to avoid sleeping in the > > get_stats64() path. > > > > Signed-off-by: Justin Lai > > Looks legit. > > One question: for how long can this poll for in real life scenarios? Up > to ~1 ms is okay-ish for atomic, but if longer, then you'd better to > split it into shorter polls and reschedule() time to time. Anyone trying to get a thread running at an RT priority won't thank you for spinning for anywhere near that long. When an RT processes becomes runnable the scheduler will preempt a lower priority process that is running on the cpu the RT process last ran on. The RT process won't run until the preempt actually happens. 1ms is a very long time. -- David > > Thanks, > Olek >