From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2A60445B1F; Sun, 13 Oct 2024 03:10:36 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D9821402C4; Sun, 13 Oct 2024 03:10:35 +0200 (CEST) Received: from mail-pf1-f180.google.com (mail-pf1-f180.google.com [209.85.210.180]) by mails.dpdk.org (Postfix) with ESMTP id 31E9A40273 for ; Sun, 13 Oct 2024 03:10:34 +0200 (CEST) Received: by mail-pf1-f180.google.com with SMTP id d2e1a72fcca58-71e427e29c7so931039b3a.3 for ; Sat, 12 Oct 2024 18:10:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1728781833; x=1729386633; darn=dpdk.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=39t7rHQOBr/kcNumDd2xGn7wgdH9fRolNUvqpaBAPfs=; b=bmlgeBb8ajd4UsfrTriEzvQq/hMddD7g6NjAeTSgGASd8ZkflZ/1fRmEMtoEfcJ5ug U4iz20Yrvvziz7BAWCCNddomN2fACS0MlSAEjSYPnT/GQUCIUlwnDUXyS6kJSnaNMwnv aIi6laL72ojkXCfoEvN+KSViECsxqAPgOZzjaPIeKO866tU4043lwkeeZSEOCWGC9w9J ehFx0inT3UlohivOvc9vAg00GmbhCg6JhshDoGklSdsdq3YPeTD59Rsed8EayK/RLilp tqUbR33qs84CTFB50hWMbv0Y46iqTcgrf+Q3mbU67lsfKuuWHZSzV42C/0EYREJsjnY+ 7yHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728781833; x=1729386633; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=39t7rHQOBr/kcNumDd2xGn7wgdH9fRolNUvqpaBAPfs=; b=XfvPIkUuSnLya7qLIXTq0vWOpWbiOxSsCgRVBOTpi9Lf+IPG8nDeGFHjtWiTMKM9rZ By114dMFPLVIdLztJ0cgKDQ2Y7iPBU0tCAZx1H75iLwWwtNvSyLzNmVlrH/7UsSIDxzT r8bznHz1ybjYAGgzzdjMOG6CGIT/4BJrBYZBFFC7zP9NTme6TEZIvvHNgbnU2YsBqLS2 k+6ydh+SSFh2Cz17BeC/9ZllNwOcArYoGmGFzEHTuqlU5eopOweUT9MUi3vIz9WNFB5/ yrrUmf3WuLMrAdQmY0Cqg5ltC5ehUew7URPkU+Bg8FvS6HbQy/6TuroMLEA9xa8wpDk5 quKw== X-Gm-Message-State: AOJu0YwBuh2v4VsA+giMugRoAz6A2q/kV/sAKf1uVCSvk8qDctrWYri0 9X48CjI3HDpE7pRbdFDH4DxbMfrreKDOqVoQkKJimZNGq+qenPHQLTp7nB0FZEY= X-Google-Smtp-Source: AGHT+IEoSaP2xf1XsMElUZN9b0cQEG2sueoiTww5Qmeit8NwBYj+/PadVaBK6LZGa0dw/YWEanodig== X-Received: by 2002:a05:6a21:1519:b0:1cf:4d4e:532b with SMTP id adf61e73a8af0-1d8c96b986bmr5200387637.43.1728781833221; Sat, 12 Oct 2024 18:10:33 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71e50e26ca9sm1587789b3a.153.2024.10.12.18.10.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 12 Oct 2024 18:10:33 -0700 (PDT) Date: Sat, 12 Oct 2024 18:10:30 -0700 From: Stephen Hemminger To: Huisong Li Cc: , , , , , , , , , Subject: Re: [PATCH v10 1/2] power: introduce PM QoS API on CPU wide Message-ID: <20241012181030.60d7647a@hermes.local> In-Reply-To: <20240912023812.30885-2-lihuisong@huawei.com> References: <20240320105529.5626-1-lihuisong@huawei.com> <20240912023812.30885-1-lihuisong@huawei.com> <20240912023812.30885-2-lihuisong@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Thu, 12 Sep 2024 10:38:11 +0800 Huisong Li wrote: > + > +PM QoS > +------ > + > +The deeper the idle state, the lower the power consumption, but the longer > +the resume time. Some service are delay sensitive and very except the low > +resume time, like interrupt packet receiving mode. > + > +And the "/sys/devices/system/cpu/cpuX/power/pm_qos_resume_latency_us" sysfs > +interface is used to set and get the resume latency limit on the cpuX for > +userspace. Each cpuidle governor in Linux select which idle state to enter > +based on this CPU resume latency in their idle task. > + > +The per-CPU PM QoS API can be used to set and get the CPU resume latency based > +on this sysfs. > + > +The ``rte_power_qos_set_cpu_resume_latency()`` function can control the CPU's > +idle state selection in Linux and limit just to enter the shallowest idle state > +to low the delay of resuming service after sleeping by setting strict resume > +latency (zero value). > + > +The ``rte_power_qos_get_cpu_resume_latency()`` function can get the resume > +latency on specified CPU. > + These paragraphs need some editing help. The wording is awkward, it uses passive voice, and does not seemed directed at a user audience. If you need help, a writer or AI might help clarify. It also ends up in the section associated with Intel UnCore. It would be better after the Turbo Boost section. > + ret = open_core_sysfs_file(&f, "w", PM_QOS_SYSFILE_RESUME_LATENCY_US, lcore_id); > + if (ret != 0) { > + POWER_LOG(ERR, "Failed to open "PM_QOS_SYSFILE_RESUME_LATENCY_US, lcore_id); > + return ret; > + } The function open_core_sysfs_file() should have been written to return FILE * and then it could have same attributes as fopen(). The message should include the error reason. if (open_core_sysfs_file(&f, "w", PM_QOS_SYSFILE_RESUME_LATENCY_US, lcore_id)) { POWER_LOG(ERR, "Failed to open " PM_QOS_SYSFILE_RESUME_LATENCY_US ": %s", lcore_id, strerror(errno));