linux電源管理(二),內核的CPUFreq(DVFS)和ARM的SCPI

更多linux系統電源管理相關的內容請看:https://blog.csdn.net/u010936265/article/details/146436725?spm=1011.2415.3001.5331

1 簡介

CPUFreq子系統位于drivers/cpufreq目錄下,負責進行運行過程中CPU頻率和電壓的動態調整,即DVFS (Dynamic Voltage Frequency Scaling,動態電源頻率調整)。
????????????????????????????????《Linux設備驅動開發詳解:基于最新的Linux4.0內核》19.2 CPUFreq驅動

CPU工作態電源管理在Linux內核中稱為CPUFreq子系統(在一些文獻中也稱DVFS),它主要適用于CPU利用率在5%~100%(對單個CPU核而言)動態變化的場景,基本方法是動態變頻和動態變壓。
????????????????????????????????《用“芯”探核:基于龍芯的Linux內核探索解析》8.2 運行時電源管理

SoC CPUFreq驅動只是設定了CPU的頻率參數,以及提供了設置頻率的途徑,但是它并不會管CPU自身究竟應該運行在哪種頻率上。究竟頻率依據的是哪種標準,進行何種變化,而這些完全由CPUFreq的策略決定。

系統的狀態以及CPUFreq的策略共同決定了CPU頻率跳變的目標,CPUFreq核心層并將目標頻率傳遞給底層具體SoC的CPUFreq驅動,該驅動修改硬件,完成頻率的變換。

????????????????????????????????《Linux設備驅動開發詳解:基于最新的Linux4.0內核》19.2.2?CPUFreq的策略

2 cpufreq_driver

2.1 簡介

每個SoC的具體CPUFreq驅動實例只需要實現電壓、頻率表,以及從硬件層面完成這些變化。
?????????????????????????????????《Linux設備驅動開發詳解:基于最新的Linux4.0內核》19.2.1 SoC的CPUFreq驅動實現

2.2?數據結構

//include/linux/cpufreq.h
struct cpufreq_driver {char        name[CPUFREQ_NAME_LEN];......int     (*target)(struct cpufreq_policy *policy,unsigned int target_freq,unsigned int relation);   /* Deprecated */int     (*target_index)(struct cpufreq_policy *policy,unsigned int index);......
};

target()和target_index()

????????實現最終調頻的接口,內部可以自行實現或調用CLK接口。

????????這是最重要的一個功能,在切換頻率時調用。它會將當前CPU核的主頻設置成CPUFreq策略提供的目標頻率。

????????????????????????????????《SoC底層軟件低功耗系統設計與實現》13.1.4 主要數據結構;3.driver相關數據結構
????????????????????????????????《?“芯”探核:基于?芯的Linux內核探索解析》8.2.1 動態變頻;(一) CPUFreq的機制部分

register和unregister接口

int cpufreq_register_driver(struct cpufreq_driver *driver_data);
int cpufreq_unregister_driver(struct cpufreq_driver *driver);

2.3 實例分析:phytium (ARM)平臺CPU的cpufreq_driver

2.3.1 phytium平臺CPU相關功能簡介

以phytium平臺的FT-2000/4 CPU為例。?

FT-2000/4 支持處理器的多種功耗管理技術,并通過 ARM 定義的 SCPI(System Control and Power Interface)[2]接口和 PSCI(Power State Corodination Interface)[3] 供系統功耗管理軟件調用。

實現 core 運行頻率的動態調節。通過 SCPI 接口,可以查詢 CPU 支持的頻率點集合,以及實現頻率的動態切換。

????????????????????????????????《FT-2000/4軟件編程手冊》(V1.4); 7.1 CPU 功耗管理

2.3.2 ARM的SCP,SCPI簡介

A System Control Processor (SCP) is a processor-based capability that provides a flexible and
extensible platform for provision of power management functions and services.

????????????????《ARM Compute Subsystem SCP Message Interface Protocols》
? ? ? ????????????????? 1.1 The System Control Processor

System Control and Power Interface (SCPI)

The SCPI is one of the primary interfaces to the SCP in an ARM CSS-based platform. It is used
to access many of the services that are exposed to the AP. The SCP is expected to be idle and
waiting for SCPI commands for most of the time after the system boot process completes.
????????????????《ARM Compute Subsystem SCP Message Interface Protocols》
? ? ????????????????? ? Chapter 3 CSS System Control and Power Interface (SCPI)

?

2.3.3?數據結構

//drivers/cpufreq/scpi-cpufreq.c
static struct cpufreq_driver scpi_cpufreq_driver = { .name   = "scpi-cpufreq",.flags  = CPUFREQ_STICKY | CPUFREQ_HAVE_GOVERNOR_PER_POLICY |CPUFREQ_NEED_INITIAL_FREQ_CHECK |CPUFREQ_IS_COOLING_DEV,.verify = cpufreq_generic_frequency_table_verify,.attr   = cpufreq_generic_attr,.get    = scpi_cpufreq_get_rate,.init   = scpi_cpufreq_init,.exit   = scpi_cpufreq_exit,.target_index   = scpi_cpufreq_set_target,
};

2.3.4?scpi_cpufreq_init()代碼大致流程

scpi_cpufreq_init();-> scpi_ops->add_opps_to_device(cpu_dev);-> scpi_dvfs_add_opps_to_device();-> scpi_dvfs_info();-> scpi_dvfs_get_info();-> scpi_send_message(CMD_GET_DVFS_INFO, ...);-> info->count = buf.opp_count;-> opp->freq = le32_to_cpu(buf.opps[i].freq);-> dev_pm_opp_add();-> dev_pm_opp_init_cpufreq_table();     //create a cpufreq table for a device

scpi_cpufreq_init()函數會使用SCPI接口獲取CPU的頻率和電壓等信息,然后根據這些信息實現一個struct?cpufreq_frequency_table。

具體信息請看SCPI命令中的Get DVFS Info命令(《ARM Compute Subsystem SCP Message Interface Protocols》3.2.9 Get DVFS Info)

2.3.5 設置頻率的流程

scpi_cpufreq_set_target();-> clk_set_rate(priv->clk, rate);-> clk_core_set_rate_nolock();-> clk_change_rate();-> core->ops->set_rate();-> scpi_clk_set_rate();-> clk->scpi_ops->clk_set_val();-> scpi_clk_set_val();-> scpi_send_message(CMD_SET_CLOCK_VALUE, ...);

《ARM Compute Subsystem SCP Message Interface Protocols》3.2.15 Set Clock Value

2.4?查看系統當前使用的cpufreq_driver

cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_driver

或者

cat /sys/devices/system/cpu/cpufreq/policy0/scaling_driver

3 CPUFreq的governor

3.1 簡介

CPUFreq策略(Governor)的主要原則是根據當前系統負載來選擇最合適的主頻/電壓。
????????????????????????????????《用“芯”探核:基于龍芯的Linux內核探索解析》8.2 運行時電源管理

3.2 數據結構

3.2.1 struct cpufreq_governor?

//include/linux/cpufreq.h
struct cpufreq_governor {char    name[CPUFREQ_NAME_LEN];int (*init)(struct cpufreq_policy *policy);void    (*exit)(struct cpufreq_policy *policy);int (*start)(struct cpufreq_policy *policy);void    (*stop)(struct cpufreq_policy *policy);void    (*limits)(struct cpufreq_policy *policy);ssize_t (*show_setspeed)    (struct cpufreq_policy *policy,char *buf);int (*store_setspeed)   (struct cpufreq_policy *policy,unsigned int freq);/* For governors which change frequency dynamically by themselves */bool            dynamic_switching;struct list_head    governor_list;struct module       *owner;
};

register和unregister函數:?

int cpufreq_register_governor(struct cpufreq_governor *governor)
void cpufreq_unregister_governor(struct cpufreq_governor *governor)

?3.2.2?struct dbs_governor;

//drivers/cpufreq/cpufreq_governor.h
/* Common Governor data across policies */
struct dbs_governor {struct cpufreq_governor gov;struct kobj_type kobj_type;/*  * Common data for platforms that don't set* CPUFREQ_HAVE_GOVERNOR_PER_POLICY*/struct dbs_data *gdbs_data;unsigned int (*gov_dbs_update)(struct cpufreq_policy *policy);struct policy_dbs_info *(*alloc)(void);void (*free)(struct policy_dbs_info *policy_dbs);int (*init)(struct dbs_data *dbs_data);void (*exit)(struct dbs_data *dbs_data);void (*start)(struct cpufreq_policy *policy);
};

3.2.3 鏈表:cpufreq_governor_list

用來存放所有注冊的governor節點

//drivers/cpufreq/cpufreq.c
static LIST_HEAD(cpufreq_governor_list);cpufreq_register_governor();-> list_add(&governor->governor_list, &cpufreq_governor_list);

3.3?現有的策略

3.3.1 performance

this governor causes the highest frequency, within the ``scaling_max_freq`` policy limit, to be requested for that policy.

//drivers/cpufreq/cpufreq_performance.c
static struct cpufreq_governor cpufreq_gov_performance = {.name       = "performance",.owner      = THIS_MODULE,.limits     = cpufreq_gov_performance_limits,
};
cpufreq_gov_performance_init();-> cpufreq_register_governor(&cpufreq_gov_performance);

3.3.2 powersave

this governor causes the lowest frequency, within the ``scaling_min_freq`` policy limit, to be requested for that policy.

//drivers/cpufreq/cpufreq_powersave.c
static struct cpufreq_governor cpufreq_gov_powersave = {.name       = "powersave",.limits     = cpufreq_gov_powersave_limits,.owner      = THIS_MODULE,
};
cpufreq_gov_powersave_init();-> cpufreq_register_governor(&cpufreq_gov_powersave);

3.3.3 userspace

This governor does not do anything by itself. Instead, it allows user space to set the CPU frequency for the policy it is attached to by writing to the ``scaling_setspeed`` attribute of that policy.

//drivers/cpufreq/cpufreq_userspace.c
static struct cpufreq_governor cpufreq_gov_userspace = {.name       = "userspace",.init       = cpufreq_userspace_policy_init,.exit       = cpufreq_userspace_policy_exit,.start      = cpufreq_userspace_policy_start,.stop       = cpufreq_userspace_policy_stop,.limits     = cpufreq_userspace_policy_limits,.store_setspeed = cpufreq_set,.show_setspeed  = show_speed,.owner      = THIS_MODULE,
};
cpufreq_gov_userspace_init();-> cpufreq_register_governor(&cpufreq_gov_userspace);

3.3.4 schedutil

This governor uses CPU utilization data available from the CPU scheduler. It generally is regarded as a part of the CPU scheduler, so it can access the scheduler's internal data structures directly.

//kernel/sched/cpufreq_schedutil.c
struct cpufreq_governor schedutil_gov = {.name           = "schedutil",.owner          = THIS_MODULE,.dynamic_switching  = true,.init           = sugov_init,.exit           = sugov_exit,.start          = sugov_start,.stop           = sugov_stop,.limits         = sugov_limits,
};
sugov_register();-> cpufreq_register_governor(&schedutil_gov);

當系統負載發生變化時,會根據負載來調整CPU頻率,流程大致如下:

cpufreq_update_util();-> data->func();-> sugov_update_single();-> sugov_deferred_update();-> irq_work_queue(&sg_policy->irq_work);-> sugov_irq_work();-> sugov_work();-> __cpufreq_driver_target();-> cpufreq_driver->target();

3.3.5 ondemand

按需(Ondemand)策略:設置CPU負載的閾值T,當負載低于T時,調節??個剛好能夠 滿?當前負載需求的最低頻/最低壓;當負載?于T時,?即提升到最?性能狀態。

//drivers/cpufreq/cpufreq_ondemand.c
static struct dbs_governor od_dbs_gov = { .gov = CPUFREQ_DBS_GOVERNOR_INITIALIZER("ondemand"),.kobj_type = { .default_attrs = od_attributes },.gov_dbs_update = od_dbs_update,.alloc = od_alloc,.free = od_free,.init = od_init,.exit = od_exit,.start = od_start,
};
cpufreq_gov_dbs_init();-> cpufreq_register_governor(CPU_FREQ_GOV_ONDEMAND);

3.3.6 conservative

保守(Conservative)策略:跟Ondemand策略類似,設置CPU負載的閾值T,當 負載低于T時,調節??個剛好能夠滿?當前負載需求的最低頻/最低壓;但當負載 ?于T時,不是?即設置為最?性能狀態,?是逐級升?主頻/電壓。

//drivers/cpufreq/cpufreq_conservative.c
static struct dbs_governor cs_governor = {.gov = CPUFREQ_DBS_GOVERNOR_INITIALIZER("conservative"),.kobj_type = { .default_attrs = cs_attributes },.gov_dbs_update = cs_dbs_update,.alloc = cs_alloc,.free = cs_free,.init = cs_init,.exit = cs_exit,.start = cs_start,
};
cpufreq_gov_dbs_init();-> cpufreq_register_governor(CPU_FREQ_GOV_CONSERVATIVE);

參考資料

? ? ? ? Documentation/admin-guide/pm/cpufreq.rst
????????《Linux設備驅動開發詳解:基于最新的Linux4.0內核》 19.2.2 CPUFreq的策略
????????《SoC底層軟件低功耗系統設計與實現》 13.1.5主要函數實現;4.ondemand governor
????????《?“芯”探核:基于?芯的Linux內核探索解析》 8.2 運?時電源管理

3.4?配置系統當前的governor

查看當前支持的governor

# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors 
performance powersave

或者

# cat /sys/devices/system/cpu/cpufreq/policy0/scaling_available_governors 
performance powersave

設置當前的governor

echo powersave > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

或者

echo powersave > /sys/devices/system/cpu/cpufreq/policy0/scaling_governor

4 其他數據結構

4.1?struct cpufreq_frequency_table;

當前CPU支持的頻率表。?

//include/linux/cpufreq.h
struct cpufreq_frequency_table {unsigned int    flags;unsigned int    driver_data; /* driver specific data, not used by core */unsigned int    frequency; /* kHz - doesn't need to be in ascending* order */
};

4.2?struct?cpufreq_policy;

每個CPU核都有自己的控制策略(cpufreq_policy)

//include/linux/cpufreq.h
struct cpufreq_policy {/* CPUs sharing clock, require sw coordination */cpumask_var_t       cpus;   /* Online CPUs only */cpumask_var_t       related_cpus; /* Online + Offline CPUs */......unsigned int        min;    /* in kHz */ unsigned int        max;    /* in kHz */unsigned int        cur;    /* in kHz, only needed if cpufreq */......struct cpufreq_governor *governor;......struct cpufreq_frequency_table  *freq_table;    //當前CPU支持的頻率表......
};

結構體成員說明

<1> cpus和related_cpus

cpus及related_cpus表示當前policy管理的CPU,cpus代表當前處于online狀態的CPU,related_cpus表示所有包含online/offline的CPU。

查看cpus和related_cpus的值

cat /sys/devices/system/cpu/cpufreq/policy0/affected_cpus
cat /sys/devices/system/cpu/cpufreq/policy0/related_cpus

<2> min/max/cur

min/max/cur表示當前policy支持的最大、最小及當前頻率。

查看或者設置min/max的值

/sys/devices/system/cpu/cpufreq/policy0/scaling_min_freq
/sys/devices/system/cpu/cpufreq/policy0/scaling_max_freq

查看cur的值

cat /sys/devices/system/cpu/cpufreq/policy0/scaling_cur_freq

????????????????????????????????《SoC底層軟件低功耗系統設計與實現》
? ? ? ? ????????????????????????????????13.1.4 主要數據結構;1.cpufreq_policy結構體

初始化函數:cpufreq_init_policy();

5 nofifier

5.1 簡介

在頻率變化的過程 中,會發送2次通知:
????????CPUFREQ_PRECHANGE:準備進?頻率變更
????????CPUFREQ_POSTCHANGE:已經完成頻率變更

數據結構:BLOCKING_NOTIFIER_HEAD(cpufreq_policy_notifier_list);

發出通知的代碼:

srcu_notifier_call_chain(&cpufreq_transition_notifier_list,CPUFREQ_PRECHANGE, freqs);srcu_notifier_call_chain(&cpufreq_transition_notifier_list,CPUFREQ_POSTCHANGE, freqs);

????????????????????????????????《Linux設備驅動開發詳解:基于最新的Linux4.0內核》 19.2.4 CPUFreq通知

6 調試

6.1 cpufreq-stats

cpufreq-stats is a driver that provides CPU frequency statistics for each CPU.

/sys/devices/system/cpu/cpu0/cpufreq/stats # ls -l
total 0
drwxr-xr-x  2 root root    0 May 14 16:06 .
drwxr-xr-x  3 root root    0 May 14 15:58 ..
--w-------  1 root root 4096 May 14 16:06 reset
-r--r--r--  1 root root 4096 May 14 16:06 time_in_state
-r--r--r--  1 root root 4096 May 14 16:06 total_trans
-r--r--r--  1 root root 4096 May 14 16:06 trans_table

????????????????????????????????Documentation/cpu-freq/cpufreq-stats.txt?

注意:
????????當使?cpufreq_driver驅動是intel_pstate時,不會存在stats/?錄

6.2?/sys/kernel/debug/tracing/events/power/

cpu_frequency_limits
cpu_frequency

6.3 cpufreq-bench

工具源碼:<kernel_src>/tools/power/cpupower/bench/

cpufreq-bench工具的工作原理是模擬系統運行時候的“空閑→忙→空閑→忙”場景,從而觸發系統的動態頻率變化,然后在使用ondemand、conservative、interactive等策略的情況下,計算在做與performance高頻模式下同樣的運算完成任務的時間比例。

?般的?標是在采?CPUFreq動態調整頻率和電壓后,性能應該 為performance這個性能策略下的90%左右,這樣才?較理想。

《Linux設備驅動開發詳解:基于最新的Linux4.0內核》 19.2.3 CPUFreq的性能測試和調優

6.4 cpupower?frequency-info|frequency-set

cpupower frequency-info
A small tool which prints out cpufreq information helpful to developers and interested users.

cpupower frequency-set
cpupower ?frequency-set ?allows ?you ?to ?modify ?cpufreq ?settings ?without ?having to type e.g. "/sys/devices/system/cpu/cpu0/cpufreq/scaling_set_speed" all the time.

6.5?cpufreq-info和cpufreq-set

cpufreq-info
A small tool which prints out cpufreq information helpful to developers and interested users.

cpufreq-set
cpufreq-set ?allows ?you ?to modify cpufreq settings without having to type e.g. "/sys/devices/system/cpu/cpu0/cpufreq/scaling_set_speed" all?the time.

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/pingmian/76796.shtml
繁體地址,請注明出處:http://hk.pswp.cn/pingmian/76796.shtml
英文地址,請注明出處:http://en.pswp.cn/pingmian/76796.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

mysql 數據庫localhost密碼忘記

使用此查詢語句&#xff1a; SELECT user, authentication_string FROM mysql.user WHERE user root; 復制對應的密碼&#xff1a; 密碼是通過md5加密后的 md5在線解密破解,md5解密加密 將密碼輸入進來 就可以直接破解了

05、Docker run命令實戰:數據卷與掛載的完整指南(下)

5.1、深度剖析 docker run 命令:原理闡釋與數據持久化實踐探究 1、更換國內yum源2、更換國內docker源3、卸載舊版docker4、docker安裝5、鏡像加速器6、鏡像下載7、docker run命令交互式啟動-it非交互式后臺運行其他參數mysql綜合案例8、持久化存儲目錄掛載數據卷掛載數據同步1…

macOS 上使用 Homebrew 安裝和配置 frp 客戶端

macOS 上使用 Homebrew 安裝和配置 frp 客戶端 (frpc) 指南 frp (Fast Reverse Proxy) 是一款高性能的反向代理應用&#xff0c;常用于內網穿透。本文將介紹在 macOS 上使用 Homebrew 安裝 frpc&#xff0c;并進行配置和管理。 一、安裝 frpc 使用 Homebrew 安裝&#xff08;…

泊松分布詳解:從理論基礎到實際應用的全面剖析

泊松分布詳解&#xff1a;從理論基礎到實際應用的全面剖析 目錄 引言&#xff1a;事件的罕見性與隨機計數泊松分布的歷史源流泊松分布的數學定義與性質 概率質量函數 (PMF)累積分布函數 (CDF)期望、方差與其他矩矩生成函數 (MGF) 與特征函數 (CF) 泊松分布的嚴格推導 極限推導…

紅寶書第三十六講:持續集成(CI)配置入門指南

紅寶書第三十六講&#xff1a;持續集成&#xff08;CI&#xff09;配置入門指南 資料取自《JavaScript高級程序設計&#xff08;第5版&#xff09;》。 查看總目錄&#xff1a;紅寶書學習大綱 一、什么是持續集成&#xff1f; 持續集成&#xff08;CI&#xff09;就像咖啡廳的…

python 辦公自動化------ excel文件的操作,讀取、寫入

一、excel文件的讀取 需要安裝的包&#xff1a;xlrd&#xff1a;讀取&#xff1b;xlwt&#xff1a;寫入&#xff1b;xlutils&#xff1a;分割、復制、篩選 sudo&#xff1a;表示以管理員身份運行命令&#xff08;mac系統中使用&#xff09; >sudo pip install xlrd xlwt x…

JAVA Web_定義Servlet2_學生登錄驗證Servlet

題目 頁面StudentLogin.html中有一HTML的表單代碼如下&#xff1a; <form action"studentLogin" method"post">學生姓名&#xff1a;<input type"text" name"stuName" value""><br>登錄密碼&#xff1a;…

爬蟲: 一文掌握 pycurl 的詳細使用(更接近底層,性能更高)

更多內容請見: 爬蟲和逆向教程-專欄介紹和目錄 文章目錄 一、PycURL概述1.1 PycURL介紹1.2 基本安裝1.3 安裝依賴(Linux/macOS)1.4 常用選項參考二、基本使用2.1 簡單 GET 請求2.2 獲取響應信息2.3 設置請求頭2.4 超時設置2.5 跟隨重定向三、高級功能3.1 POST 請求3.2 文件上…

利用 限制torch線程數與異步方法提升聲紋識別效率

引言 聲紋識別作為生物識別技術的重要分支,在安防、金融、智能助手等領域應用廣泛。隨著數據量的增長和應用場景的復雜化,提高聲紋識別效率成為關鍵問題。本文將詳細介紹如何通過 torch.set_num_threads 以及異步方法來優化聲紋識別的性能。 聲紋識別效率瓶頸分析 在聲紋…

軟考高級系統架構設計師-第12章 系統質量屬性與架構評估

【本章學習建議】 根據考試大綱&#xff0c;本章不僅考查系統架構設計師單選題&#xff0c;預計考11分左右&#xff0c;而且案例分析和論文寫作也是必考&#xff0c;對應第二版教材第8章&#xff0c;屬于重點學習的章節。 12.1 軟件系統質量屬性 12.1.1 質量屬性概念 軟件系…

SecProxy - 自動化安全協同平臺

本人為甲方安全人員&#xff0c;從事甲方工作近6年&#xff1b;針對在甲方平時安全工作的一些重復、復雜、難點的工作&#xff0c;思考如何通過AI、腳本、或者工具實現智能且自動化&#xff0c;于是花平時空閑時間準備將這些能力全部集中到一個平臺&#xff0c;于是有了這個東西…

CSI-external-provisioner

main() 這段Go代碼是一個CSI&#xff08;容器存儲接口&#xff09;Provisioner&#xff08;供應器&#xff09;的實現&#xff0c;用于在Kubernetes集群中動態提供持久卷。代碼涉及多個組件和步驟&#xff0c;下面是對關鍵部分的解釋&#xff1a; 初始化和配置 命令行標志和…

react中通過 EventEmitter 在組件間傳遞狀態

要在 Reply 組件中通過 statusChangeEvent 發送狀態值&#xff0c;并在 Select 組件中接收這個狀態值 status&#xff0c;你可以按照以下步驟實現&#xff1a; //Event.jsimport EventEmitter from events;export const statusChangeEvent new EventEmitter();// 工單狀態切換…

1534. 統計好三元組

1534. 統計好三元組 - 力扣&#xff08;LeetCode&#xff09; 給你一個整數數組 arr &#xff0c;以及 a、b 、c 三個整數。請你統計其中好三元組的數量。 如果三元組 (arr[i], arr[j], arr[k]) 滿足下列全部條件&#xff0c;則認為它是一個 好三元組 。 0 < i < j &l…

如何配置AWS EKS自動擴展組:實現高效彈性伸縮

本文詳細講解如何在AWS EKS中配置節點組&#xff08;Node Group&#xff09;和Pod的自動擴展&#xff0c;優化資源利用率并保障應用高可用。 一、準備工作 工具安裝 安裝并配置AWS CLI 安裝eksctl&#xff08;EKS管理工具&#xff09; 安裝kubectl&#xff08;Kubernetes命令…

FPGA_UART

1.UART 概述 &#xff08;通用異步收發傳輸器&#xff09; 1. 基本定義 UART&#xff08;Universal Asynchronous Receiver/Transmitter&#xff09;是一種常見的串行通信協議&#xff0c;用于在設備間通過異步串行通信傳輸數據。它不依賴獨立的時鐘信號&#xff0c;而是通過預…

openwrt軟路由配置4--文件共享

1.安裝samba opkg update opkg install luci-app-samba4安裝好之后重啟設備&#xff0c;系統界面服務下面會多一個network shares 2.創建磁盤分區并掛載到共享目錄 openwrt剛剛安裝的時候空間都是很小的&#xff0c;共享目錄我是打算用來存放一些電影視頻之類的大文件。所以我…

Vue ‘v-model‘ directives require the attribute value which is valid as LHS.

1、問題描述 在項目開發中&#xff0c;如果將el-checkbox組件的v-model指令改為使用三元表達式時&#xff0c;會報出【vue/valid-v-model】的錯誤&#xff0c;如下圖所示&#xff1a; 2、分析原因 根據錯誤提示&#xff0c;是因為v-model指令始終把Vue實例的data視為數據真實…

基于 Qt 的 BMP 圖像數據存取至 SQLite 數據庫的實現

基于 Qt 的 BMP 圖像數據存取至 SQLite 數據庫的實現說明 本項目通過 Qt 框架實現了將 BMP 圖像文件以二進制形式存入 SQLite 數據庫&#xff0c;并可從數據庫中讀取還原為 BMP 圖像文件的功能&#xff0c;適用于需要圖像與結構化數據統一管理的場景。 整個流程分為兩個主要部…

嵌入式基礎(三)基礎外設

嵌入式基礎&#xff08;三&#xff09;基礎外設 1.什么是UART&#xff1f;與USART有什么區別??? (1)什么是UART 通用異步收發傳輸器&#xff08;Universal Asynchronous Receiver/Transmitter)&#xff0c;通常稱作UART。是一種異步全雙工串行通信協議&#xff0c;它將要…