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=1796346666; b=mwigtS5GGktXPmFgJc5rbiLycfxUjTxu2XGrjMa4X4usRbMYfYwz3LKuaZ9TGHJJrcVJ 5WdSRsmtUC8VhAOuoEKjsXmKCU6lYDh9ZUXjcrv2resq9g2gF6xrTpyHEmZDFYgNQSyg1 t5yMSsWixvWbtBZL5+k1qV2PpO4F+5TznoCFHO1g+u7sEUsDDIKBRYZSSuW5ye4rg+vWD Jpo+zQcPpy5HK+ppbFmsCFPwxCkqrmsgFG1NWHkuP0dlAv5YwG66z1ABgswShVXYrp1yC 01ZFjk2ai40Q73RwKbn4hFLtnKfj4ZU1J8oT0PGB/tGIPgMfcQpEpBnBXMHdidINx1g== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796346666; 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=YQWyDLhbG0Juv2/rA2xt5JmzL9rn/Ztj0rDPVJ8zntREhfFkQXXrwjFEBPamQLqdpx1l 9zmH9ErC/cGmp8k9XcYslTS4bsQcPRRdj7EnjLijLK+hIj1Tgi5EVQt+Usg6xdzQBsjCh u1HSIsq+MkKTWl0Pe4dx4EPFtdeZ5FYxtKBNxzmiRppW5rHF+A0PbCuJ31y/hTVmoFWx2 4TBs0At00JtBlUtyta6RaOZKzFe4qres/Hk0S0TSrfB858lP2RTTg8Qw+j6nVjhbj5nCR GuhFdvKdN723PI+LEfVs1Pd8TWr+vQpr9r1Zpv+8wcXvn28Gxw1uf8EmbQNe5nV7kag== 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 6780D606A32F for ; Fri, 4 Dec 2026 01:11:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 6780D606A32F 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.a=rsa-sha256 header.s=20260707 header.b=Lg/Wislc Received: by mail-ed2-f11.google.com with SMTP id 4fb4d7f45d1cf-6a60463276bso8297a12.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=xZVRW7RZYCS5WgVsloCo9YP4cqvn2KxZfM6qcH8/KlxhyTU2rlEa2dYQ11VpWGIwlr eIclsJgVCfb5tVoH9ftm5EY3KXr74q3geiPFrAB5MkITaJJACBihvdmeENNXgPMCSSSb svIDnsc6Jhk/4TglNNTQsGysWgFwCbsGaoI/Bqia+s2x5V6cvCbQtLc7qIivqFU1JpgD eeoX+AHdVo09DLvcneS2/5kFbOCZ9L1Dc9lTqhIIaYID90KlEG7zOf3pamaAIP6w363Z +blK4LWsf/ptRKTp5DbH+q4GojBUNRt9jiasD6eVmzEwoJj5Zl//xuHbUoxqVw72lDsP e2mQ== X-Forwarded-Encrypted: i=1; AL+hErFXxS4nhkLDIm2uaQiXMF4TPwbXTgqesSHk3fgyW0I/VA2TyhZxQtg2ZJD7RAQmXfPcUl4vGz6aU9o=@vger.kernel.org X-Gm-Message-State: APuU4Z9NjnxnhyWEZrFZ84myfmqmqLwo97zCsZpOGnSwnTg3s5zBcOSZ fhWnp3RBmBRHyRQDNXDI4INfftl+1cgFvnhLuCIuqO4w0U8Dvz4p9Tfy X-Gm-Gg: AZFdTZe6qXM0gTdAn8EhpQ984ugUwmr29NPB/UfblNme+3AVAUVYIFZc8gkrMzzlWzW RTwMjPj3hQ2KbUw7z/DgUaKlYA2fQ+Bpr2UUPQNsIasWvjmgCUdAQT90ij/NwH7EGzV9QnYzu5f GGqQWuAxBwpUocns1QQd6FVKBs7vkObBrKd9ynMSMvohwzhvFArbZOPn+8ECMG8ShZq3SPdhFL7 ZDtkmovoc2C02DRe64Gw2rOTSDr0N7b5aOHEPLHZ02cDZlqyWq9WGZ2FAfwuK7gDX9a7IGVy0XP 9lYBUyCD/I6psJkwrVwCLr+3jgsAObPfGkhVsSThyLrp8VQV3cJM4PpvhjV2xk17I/3nKcfFDi/ 7UTe4gE1qkE9ONmK5ERslj242UVOZ19HPJZwjJMUXDJf1HJq/zRRyNn4X8ybJeExlZedGte0P2E 2CaEHVc5B0c6S+DPF8/VtUMEsu1qukjvkbm+fqX0bYtgVQnVQ4JZn+ZHuCg3Imhri9v/aB8US9i R84q21pB424bqnikyt0S3UUsgyNX+cb+82sBXFmC6om1mCF+bMIG/0h/XTSX6hGkMETuM2YMSLz C+2GSNQcb7X0opcYIgTp/4yYAbG4XhX7TCYBxTWcmlHV8U5LXKdj8g6evaQKNwwTO+j+NuN4aXv vfyZEkg== 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-doc@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