From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.228.75 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796346665; b=d5jtY5YA0exDVx2sB74H9Tbcmmxl4HmBx6EzRWUp9tzNFpfEYrMvJjJOJkarHSZRqvFr 9VpWpAoMjX3bNqw6ZjFnkPjYDZtm0jizHoo0bsMBeJpPXW9W3nwrtFAkjRMpc2Iv8c51P kGuMUxt0YvG0Gnp+A/9/8LtiQAg/GFRLXulL9scbyBi8SL6USEtMcICQK/3exKMN/RJ5F bA6EBdAEV5Dvh2nbkbfiKgvP+ZxqxRb5ygWle+TQ1I8tsCLochGLCjDC++nWr5hPlRP1t eoCgRQ9ukQa1Jfe+w2RFIv0RWETsk5T4OEP0YKtWREz+LQRzl/ApFNDOmxHpm3JrE6w== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796346665; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:To:Cc:Subject:Date:Message-ID:X-Mailer:MIME-Version:Content-Type: Content-Transfer-Encoding; bh=rkhdUWAkx9UA+NNUGQBFCnaYSdmVBlfMcc9lTSJiXiQ=; b=Q5L40dYzGYNx3LDUdRN1nvQZYdEqLErTR/+Y6yi5EMloMZZxYlM17nGwg6fCKmrR92a7 +vM1ZEHeYDH+0Cem6xP+zoe+0k/6GLoYr2NyM9wOke1btE92H+JkOFOGN6IAZ/OVevy+5 f/RYVB46S1/q6xM84n+poCgUF958DWt2iVxHrPrsOG/XzyQbM0XcdDa/7RdJS4NhQ2Dyd LiDtC+4MeDFLQzuc8RWi39e1uL0LnovannsECrL/qk9jExOaloJYj3TnGXnUlwQfYZ14H /FR+zsrVzfPKsra1lBOVTHDWxc6P/gAyt6TU1PeNwiaLVkbfM1feTiGnofK8u8Eshng== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b="Lg/Wislc"; arc=none smtp.remote-ip=74.125.228.75 Received: from mail-ed2-f11.google.com (mail-ed2-f11.google.com [74.125.228.75]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 67847606A330 for ; Fri, 4 Dec 2026 01:11:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 67847606A330 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, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=Lg/Wislc Received: by mail-ed2-f11.google.com with SMTP id 4fb4d7f45d1cf-6a60463276bso8298a12.1 for ; Thu, 03 Dec 2026 17:11:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796346664; x=1796951464; darn=vger.kernel.org; h=content-transfer-encoding:content-type:mime-version:message-id:date :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to :content-type; bh=rkhdUWAkx9UA+NNUGQBFCnaYSdmVBlfMcc9lTSJiXiQ=; b=Lg/Wislc1nYFxyIEe3LCYv7V9yMKLHgt0QAZ9246s4z5f2queuSl0dS9CaRMpJylCz 8oNEsKftlTYygIYmxUYhwqOOP7OFvhgVUuC9/GgnOVZgBTvIJ5CRcKE28ycTZey7lHTE txgTmmWm4tIGUDi7hyVx2Co0nbWwpQGdsDRh3vb7NmiOpkbLJq9bSErr1zMw8OS2CuZE YxKsEa+Kei86B0H19fBmv6DA2dfDf85HUMpbTCn5h/ydlvRmYlMqhJUfOSwOlAFkFDvc q0Qt2c4Rs75g8Fk2rKQOMC8lcy7LxrrdruJn/P9XMkRzcn+ANyzZZua15iaE/tpMbuYB NtVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796346664; x=1796951464; h=content-transfer-encoding:content-type:mime-version:message-id:date :subject:cc:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to:content-type; bh=rkhdUWAkx9UA+NNUGQBFCnaYSdmVBlfMcc9lTSJiXiQ=; b=MuEZ7GRIDPFysy3KxkVSfQwQhO5Hp/t7L89uf/lrrgxX33b/S6XZIFplMbe3V+YmhL AheZPNVDszFnknEVMqe5fjRdu6KgCMc06egMgPNHNb5vBnk+EbbMxmaHR0+bA0qSkOTN B/oThlmEPb7boVtt1+mh75NTGe4gl0J38561t2lcvR2xBdRO3dYM6Obi5nYTDPq8ZnKG 1+Frltx38q8+ymWSfLJonQNjuhKA56yPYilm3EJbE54uZGkVPdHZBw0cpJ+tcB0114eu pOTOS5Mti3WIEAj1Jr/u9Ep/m6ZlX69bcxLjLg/R7/N65PVLWUkxqZP5/i6gqlCKgu3l Ualg== X-Forwarded-Encrypted: i=1; AL+hErFZMW2IDGf0F2izzhQagzxgGR7Obipv+bKoNOl7qKxyNb4pXcTR1i3QhRq0qMx/Go/DGH/+4/v55ViFeY8=@vger.kernel.org X-Gm-Message-State: APuU4Z+11eLRg475t2zuRMb2ffmYpi1udoNarma3GblYKa7hbk1FmeuV U6UEaRt/i29BDsYpzueiuUwR5ahEvvH7lYOq8MEIvpu3A6VG2UXHdDJa X-Gm-Gg: AZFdTZfe9CoTa8ifezcGi8ZsgCAx1Hb5wj1gWRX4puELQV28t3J3JpB+CYQMRIvlQN5 py7ifpzKCigq6rcKEpu+2VUjrt9KZh7kL3RmqhyoWVdk6QyTLZAZ/gEHhj1tJCv4KmZn6rYVjOo kFI0I/fgX76+NxD3kMaM38tJ077abHhckl/iwcHLQLvkOSOD/x359VkOh3em8HBuanVnIpL8Rzo U5RbS14003maSgoTLYsF2dt3fBbBPKoDlQHbmBw3CgztnsC2uRuXGsVKNkjN3Mp/OLESZxH+GmX IEIZSD7j7u+5DWNK0/TbNrwHzq4ozqVqTd041Vaha9w4Cu5kLw8uAoem/Ib32GBjvqqnboNculC bhnYdREWhK8qjZJb++zOjPNWnG1HXOedaIbKLDWEeOEVYtzdgzdsKVh8zfuqj3CCZmESv5DmTK2 72RqkZh9VF3oVTm+Wm281U8fY6jo4S36u9sEMcfY4Vja90ionZbZepA+alohu5uH+C6Tt7CINNN KXXGeXxQRrr3GH3IZftJsGXtYAmZPjOzur8zqOBHNdSXCWsdEWNQ2fuMQduWxfJyNbyoquvUtrt 5aD+hLMjG0beWxJIe0ZoA5U25HcixYzvjZuIfdrkxAeTmkXhtnmWrrwO21zQzGlH2LVXg4pSlnM HHP+g7A== X-Received: by 2002:a05:6402:234b:b0:6b8:4f3e:62c8 with SMTP id 4fb4d7f45d1cf-6bcbee5148dmr432344a12.0.1796346663441; Thu, 03 Dec 2026 17:11:03 -0800 (PST) Received: from localhost.localdomain ([41.63.177.247]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-6bcbbeb3572sm295616a12.2.2026.12.03.17.10.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Dec 2026 17:11:01 -0800 (PST) From: "Efraim E. Vander" To: Daniel Pereira , Jonathan Corbet Cc: Shuah Khan , Randy Dunlap , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, "Efraim E . Vander" Subject: [PATCH v2] docs: pt_BR: Translate admin-guide/cpu-load.rst Date: Fri, 4 Dec 2026 01:09:42 +0000 Message-ID: <20261204010943.65069-1-efraimvander64@gmail.com> X-Mailer: git-send-email 2.43.0 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add the Brazilian Portuguese translation of the CPU load documentation. Update the admin-guide index to include the translated document and remove it from the translation TODO list. Signed-off-by: Efraim E. Vander --- Changes in v2: - Add cpu-load to the admin-guide toctree. - Remove cpu-load from the translation TODO list. .../pt_BR/admin-guide/cpu-load.rst | 119 ++++++++++++++++++ .../translations/pt_BR/admin-guide/index.rst | 2 +- 2 files changed, 120 insertions(+), 1 deletion(-) create mode 100644 Documentation/translations/pt_BR/admin-guide/cpu-load.rst diff --git a/Documentation/translations/pt_BR/admin-guide/cpu-load.rst b/Documentation/translations/pt_BR/admin-guide/cpu-load.rst new file mode 100644 index 000000000..56ef8d658 --- /dev/null +++ b/Documentation/translations/pt_BR/admin-guide/cpu-load.rst @@ -0,0 +1,119 @@ +.. SPDX-License-Identifier: GPL-2.0 + +============= +Carga da CPU +============= + +O Linux exporta diversas informações por meio de ``/proc/stat`` e +``/proc/uptime``, que ferramentas do espaço do usuário, como ``top(1)``, +utilizam para calcular o tempo médio que o sistema passou em determinado +estado, por exemplo:: + + $ iostat + Linux 2.6.18.3-exp (linmac) 02/20/2007 + + avg-cpu: %user %nice %system %iowait %steal %idle + 10.01 0.00 2.92 5.44 0.00 81.63 + + ... + +Nesse caso, o sistema considera que, durante o período de amostragem +padrão, passou 10,01% do tempo executando tarefas no espaço do usuário, +2,92% no kernel e permaneceu ocioso durante 81,63% do tempo. + +Na maioria dos casos, as informações de ``/proc/stat`` refletem a +realidade com bastante precisão. No entanto, devido à forma e ao momento +em que o kernel coleta esses dados, às vezes não se pode confiar neles. + +Então, como essas informações são coletadas? Sempre que uma interrupção +do temporizador é sinalizada, o kernel verifica que tipo de tarefa +estava em execução naquele momento e incrementa o contador correspondente +ao tipo/estado dessa tarefa. O problema é que o sistema pode ter alternado +entre vários estados diversas vezes entre duas interrupções do +temporizador, mas o contador é incrementado apenas para o último estado. + +Exemplo +------- + +Imagine um sistema com uma única tarefa que consome ciclos de CPU +periodicamente da seguinte maneira:: + + Linha do tempo entre duas interrupções do temporizador + |--------------------------------------| + ^ ^ + |_ algo começa a trabalhar | + |_ algo entra em suspensão + (mas é despertado pouco depois) + +Na situação acima, a carga do sistema será de 0% de acordo com +``/proc/stat`` (pois a interrupção do temporizador sempre ocorrerá +quando o sistema estiver executando a rotina de ociosidade), mas, +na realidade, a carga estará mais próxima de 99%. + +É possível imaginar muitas outras situações em que esse comportamento +do kernel levará a informações bastante inconsistentes em ``/proc/stat``:: + + + /* gcc -o hog smallhog.c */ + #include + #include + #include + #include + #define HIST 10 + + static volatile sig_atomic_t stop; + + static void sighandler(int signr) + { + (void) signr; + stop = 1; + } + + static unsigned long hog (unsigned long niters) + { + stop = 0; + while (!stop && --niters); + return niters; + } + + int main (void) + { + int i; + struct itimerval it = { + .it_interval = { .tv_sec = 0, .tv_usec = 1 }, + .it_value = { .tv_sec = 0, .tv_usec = 1 } }; + sigset_t set; + unsigned long v[HIST]; + double tmp = 0.0; + unsigned long n; + signal(SIGALRM, &sighandler); + setitimer(ITIMER_REAL, &it, NULL); + + hog (ULONG_MAX); + for (i = 0; i < HIST; ++i) v[i] = ULONG_MAX - hog(ULONG_MAX); + for (i = 0; i < HIST; ++i) tmp += v[i]; + tmp /= HIST; + n = tmp - (tmp / 3.0); + + sigemptyset(&set); + sigaddset(&set, SIGALRM); + + for (;;) { + hog(n); + sigwait(&set, &i); + } + return 0; + } + + +Referências +----------- + +- https://lore.kernel.org/r/loom.20070212T063225-663@post.gmane.org +- Documentation/filesystems/proc.rst (1.8) + + +Agradecimentos +-------------- + +Con Kolivas, Pavel Machek diff --git a/Documentation/translations/pt_BR/admin-guide/index.rst b/Documentation/translations/pt_BR/admin-guide/index.rst index cb5a64f82..2195b6a99 100644 --- a/Documentation/translations/pt_BR/admin-guide/index.rst +++ b/Documentation/translations/pt_BR/admin-guide/index.rst @@ -26,6 +26,7 @@ etc. README devices + cpu-load features Uma grande parte da interface administrativa do kernel são os sistemas de @@ -109,7 +110,6 @@ Todolist: * cgroup-v2 * cgroup-v1/index * cpu-isolation -* cpu-load * mm/index * module-signing * namespaces/index -- 2.43.0