From nobody Mon Dec 23 01:54:34 2024 X-Original-To: freebsd-hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YGh0p6B16z5hdN2 for ; Mon, 23 Dec 2024 01:54:50 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic301-20.consmr.mail.gq1.yahoo.com (sonic301-20.consmr.mail.gq1.yahoo.com [98.137.64.146]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4YGh0n3Gw6z4b0Q for ; Mon, 23 Dec 2024 01:54:49 +0000 (UTC) (envelope-from marklmi@yahoo.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=yahoo.com header.s=s2048 header.b=LBDli9xh; spf=pass (mx1.freebsd.org: domain of marklmi@yahoo.com designates 98.137.64.146 as permitted sender) smtp.mailfrom=marklmi@yahoo.com; dmarc=pass (policy=reject) header.from=yahoo.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1734918887; bh=oh9m16En1AJ0eRT4pHUZe8MtxlwUI5g5BiRjzm6qTa4=; h=From:Subject:Date:References:To:In-Reply-To:From:Subject:Reply-To; b=LBDli9xh3+ilXZiVFZPvJeYevxEDisqSGQUUqFw8DS9E+xfWtV7qyPucltZO+1+CAf6GMcIZhENhNMpawxl+/KVWRBH5IeU/3XwLeeVV3wvG2RkYXgF3FUfQRbKrkr+W5FEr0gZ94lTBBMEs9Ietzh1EywEH4BGdSs68ACED2lxTQuTw1LLcMThBkuu8iOFw63/nBBrIre49uUZi35NMyZcL57D4fiUxwrAIuCH24mOAJcmzCoxTAQFKzJxnAAvAQvOtXq8Vabl3AwGq+DHg2evdHM0i/XyVLA1w+O7RdinNI45m+F1ojUZXb9yfV77/KygE7kJnF7VnSzeKq5YQhQ== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1734918887; bh=r9cgcqOPS3qJ0OONFcMmH58PGA5/3AXeuRJb17CWTw+=; h=X-Sonic-MF:From:Subject:Date:To:From:Subject; b=TFb/o5j9dGA2reYWMNXmvo+6fJbnRoapU4Fa6CoQolRE2lpv54Yn9qm7eThj363Ql+2oyUxN7wTKCV4K4KJ8mgoUTcNdnU60oTqDG5/1mV4n8NuFS5X5qyMSSMB33ETqeMN7ssI1fRrwppICr6yYKxTGuRB2nggbFql86WvVzMEj7X+jTqUueWUb52O/8VFLMAwPvVYmlO0yHpUKn8MRIhbgcAD31vVQd6R8Jltz+SRr6H/68G9Czjp8WbQ3JZ9aPdjHvHxcfdvRc7HBOQP1zJN76wHGciyG25QJs+300oUQwPAZHz/456RtHWeyTifhIfussjdf3jOAIcasMebG4A== X-YMail-OSG: 7BsT5EsVM1l92tVJkczJeMsPaLYCBqJU.KQkWvP_xQFR.GiqIwOL.Ps186.Ep4B L9RObl4fSCFMXpRaxjxfBz1auGSI3W.iCVS3ufBSMHLr.oX_8F3UASWSkv49_R3saTFGdY1J9Weg FkUwisnEm7JKVaIaTMClXsLlTO7LcpQRbV9SAW6kmWH5sjLK1VWijeD4yyF_qNtrcDwRBxQq8eiz .4s24sjiPPFwD9WQjf9dqOvu4vABOQwyvC9LCPUbuNNo..NDWHyVFqfh4Pvu.CiheR0h7ca8spKN F8CjlksbBTvB1NNuFrKho6gTEK9A6__WJk_Ev_q9mkuoAYEuxERmrEZp8v2EU.aI.7FKAXxYCH.C pN4o22CTKIz2rZfbFr0ku3lnXUK2hmet9eXYFwMLD90ia67DLPp6fOpNrXloKi2qnyK4hrU0WF4C _7UzPvIQXfkzHQ9sYyjGmrKT6uNCCv3z1IpjaAHRjdKMn80HIrAkkIh76EHN62TymqOtMdYPEgpO 4Dg7sWotgpSqdnpkMRSoL53OW_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KH.PjWNTIFkwzyagJ41xwYEKQFSV5XIFzujKv.l2JjEBQDFa9lxH47lx hpT_C7_NGvjkMCCrvg3u9cVTBl1ubwfHreiAufIvKHVCQKGruO_cctBktqZkIeJfqXQk63FzSaoO VI3SLZZYRfbMnv5WqwCwnfn7N8WM9UWipsUC7GaEcP5jDCsw.bRZ8Z_TZrcQE7HzeMj8SqvPVdhH NzBWi7jJyXMJoXI0Efke1LbmvUHoVpoHyJ62z3OKBcHX1sLYcgvglEJgoOI9bM_v27FfSQzIf33R y5QNku0aOaICC09VdyHc17Vb_7ovaIK8QBou_2YMhcCC_yGsjhbCO2UVd_2su_huPSrTCkFGkBeU PHrV1dEA7T8InfKKAV4WxKd6FRHOH.Up28Y1sllUI3Ng9OAIw84g2JajjtpPy76QISmg53Aq9nRG HQ9JX9Tjp2dI0tFYNlI.gL3YDQQZ4tXXPoyZAXxKOxHt__EvOTgB7tWc17dGJ3NjBOhPGSlWGgo1 v2y7VmU1ozOVlaVnFAWltp4.iSNFd.ip6cBTSv.KKlWfdo.8p853E4J6UjpGzRsG9BFAJHS2yHTt HEpvQ.jYwbhgbWqE0DALI_YQ90JtCBqa9W2DAoz1ct_7vzmXW79_h7B8saw5TvPODzdRTUHNPQ7K 6zl1OHRjTfCXsWAATo_TcjTOVRqp6dFyiY_squGd2PXXsEJIMu7.9QP.jjkDEPZWPQPbDtiSMSxA ahQ-- X-Sonic-MF: X-Sonic-ID: 481da0f2-cd7f-4d36-8099-155ee742de25 Received: from sonic.gate.mail.ne1.yahoo.com by sonic301.consmr.mail.gq1.yahoo.com with HTTP; Mon, 23 Dec 2024 01:54:47 +0000 Received: by hermes--production-gq1-5dd4b47f46-qfm2r (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID b622b37c6b8fd4124672f1fb88dfdf27; Mon, 23 Dec 2024 01:54:45 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@FreeBSD.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.300.87.4.3\)) Subject: Re: How can the process be consuming significant CPU time and always have "nanslp" state? Date: Sun, 22 Dec 2024 17:54:34 -0800 References: <52541F10-F1EE-4D85-8F6C-25627579E362@yahoo.com> To: Yuri , freebsd-hackers In-Reply-To: <52541F10-F1EE-4D85-8F6C-25627579E362@yahoo.com> Message-Id: <0A125B16-AD97-49E6-BB94-BCD9EAF540CA@yahoo.com> X-Mailer: Apple Mail (2.3826.300.87.4.3) X-Spamd-Result: default: False [-2.50 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; SUBJECT_ENDS_QUESTION(1.00)[]; NEURAL_HAM_SHORT(-1.00)[-1.000]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; MIME_GOOD(-0.10)[text/plain]; RCPT_COUNT_TWO(0.00)[2]; RCVD_TLS_LAST(0.00)[]; TO_DN_ALL(0.00)[]; ARC_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; MIME_TRACE(0.00)[0:+]; FREEMAIL_FROM(0.00)[yahoo.com]; FROM_HAS_DN(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; ASN(0.00)[asn:36647, ipnet:98.137.64.0/20, country:US]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; DKIM_TRACE(0.00)[yahoo.com:+]; MLMMJ_DEST(0.00)[freebsd-hackers@freebsd.org]; RWL_MAILSPIKE_POSSIBLE(0.00)[98.137.64.146:from]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[yahoo.com:dkim]; RCVD_IN_DNSWL_NONE(0.00)[98.137.64.146:from] X-Rspamd-Queue-Id: 4YGh0n3Gw6z4b0Q X-Spamd-Bar: -- [I forgot to include the list in the reply the first time.] Yuri wrote on Date: Sun, 22 Dec 2024 22:34:01 UTC : > I am running one long-running process that is always shown in ps(1) with > WCPU between 50% and 400% and STATE=nanslp, like this: What was the specific ps command used? > > PID USERNAME THR PRI NICE SIZE RES STATE C TIME WCPU > COMMAND > 61262 yuri 29 20 0 13G 5986M nanslp 2 161:47 85.55% > python3.11 I expect that "THR" being "29" means 29 FreeBSD threads are in use in the FreeBSD process. STATE at the process level does not say much about the thread-by-thread status. The threads of a process need not all be the same over any given interval, no matter how short or how long. > PID USERNAME THR PRI NICE SIZE RES STATE C TIME WCPU > COMMAND > 61262 yuri 29 20 0 13G 5912M nanslp 5 164:25 121.84% > python3.11 That is part of how the WCPU figure can be notably over 100% , something single threaded can not normally do. > PID USERNAME THR PRI NICE SIZE RES STATE C TIME WCPU > COMMAND > 61262 yuri 29 20 0 13G 5912M nanslp 2 164:52 158.78% > python3.11 > > PID USERNAME THR PRI NICE SIZE RES STATE C TIME WCPU > COMMAND > 61262 yuri 29 20 0 13G 5835M nanslp 4 172:58 234.43% > python3.11 > > > I sampled it hundreds of times, but STATE was always "nanslp". Do not expect thread-by-thread detail tracking from a process-level summary, unless you know the process is basically single threaded. > How can this be that the process is never in RUN or any other state, but > it keeps running? Threads are each scheduled separately. There is no, single, accurate overall process STATE generally. (There are limiting conditions with such a status with all/most threads in the same STATE.) > Shouldn't STATE at least sometimes be RUN? It might only be showing the original main-thread's state, the thread that was present before the others were created. "STATE" is not something that shows proportions across multiple examples well. You could choose to have ps show all the threads individually. Then you would likely see a mixture with RUN or CPUn's involved. === Mark Millard marklmi at yahoo.com