Merge ~kajiya/+git/gce-compute-image-packages:ubuntu/jammy-update-to-20240307.00 into ~ubuntu-core-dev/+git/gce-compute-image-packages:ubuntu/jammy

Proposed by Chloé Smith
Status: Merged
Merged at revision: 5b1b661964732002d27a3b9ddd45d2293c67e00a
Proposed branch: ~kajiya/+git/gce-compute-image-packages:ubuntu/jammy-update-to-20240307.00
Merge into: ~ubuntu-core-dev/+git/gce-compute-image-packages:ubuntu/jammy
Diff against target: 192 lines (+67/-21)
5 files modified
OWNERS (+5/-2)
debian/changelog (+23/-0)
src/lib/udev/google_nvme_id (+1/-1)
src/usr/bin/google_set_hostname (+2/-1)
src/usr/bin/google_set_multiqueue (+36/-17)
Reviewer Review Type Date Requested Status
Utkarsh Gupta Approve
Review via email: mp+466398@code.launchpad.net

Commit message

Update upstream source from tag 'upstream/20240307.00' (LP: #2066314)

To post a comment you must log in.
Revision history for this message
Utkarsh Gupta (utkarsh) wrote :

Thanks, this looks good. I've adjusted the d/ch a bit and sponsored your upload:

$ dput ubuntu ../gce-compute-image-packages_20240307.00-0ubuntu1\~22.04.0_source.changes
Uploading gce-compute-image-packages using ftp to ubuntu (host: upload.ubuntu.com; directory: /ubuntu)
running supported-distribution: check whether the target distribution is currently supported (using distro-info)
{'allowed': ['release', 'proposed', 'backports', 'security'], 'known': ['release', 'proposed', 'updates', 'backports', 'security']}
running required-fields: check whether a field is present and non-empty in the changes file
running checksum: verify checksums before uploading
running suite-mismatch: check the target distribution for common errors
running check-debs: makes sure the upload contains a binary package
running gpg: check GnuPG signatures before the upload
Uploading gce-compute-image-packages_20240307.00-0ubuntu1~22.04.0.dsc
Uploading gce-compute-image-packages_20240307.00.orig.tar.xz
Uploading gce-compute-image-packages_20240307.00-0ubuntu1~22.04.0.debian.tar.xz
Uploading gce-compute-image-packages_20240307.00-0ubuntu1~22.04.0_source.buildinfo
Uploading gce-compute-image-packages_20240307.00-0ubuntu1~22.04.0_source.changes

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/OWNERS b/OWNERS
2index 80fc96d..59fca61 100644
3--- a/OWNERS
4+++ b/OWNERS
5@@ -2,12 +2,15 @@
6 # See the OWNERS docs at https://go.k8s.io/owners
7
8 approvers:
9+ - a-crate
10+ - ajorg
11 - bkatyl
12 - chaitanyakulkarni28
13 - dorileo
14+ - drewhli
15+ - elicriffield
16+ - gaughen
17 - jjerger
18 - karnvadaliya
19 - koln67
20- - quintonamore
21- - vorakl
22 - zmarano
23diff --git a/debian/changelog b/debian/changelog
24index 011eabe..1dd02ce 100644
25--- a/debian/changelog
26+++ b/debian/changelog
27@@ -1,3 +1,15 @@
28+gce-compute-image-packages (20240307.00-0ubuntu1~22.04.0) jammy; urgency=medium
29+
30+ * Rebuild for Jammy Jellyfish (LP: #2066314)
31+
32+ -- Chloé 'kajiya' Smith <chloe.smith@canonical.com> Thu, 23 May 2024 11:38:15 +0100
33+
34+gce-compute-image-packages (20240307.00-0ubuntu1) oracular; urgency=medium
35+
36+ * New upstream version 20240307.00. (LP: #2066314)
37+
38+ -- Chloé 'kajiya' Smith <chloe.smith@canonical.com> Tue, 21 May 2024 14:03:23 +0100
39+
40 gce-compute-image-packages (20230808.00-0ubuntu1~22.04.1) jammy; urgency=medium
41
42 * debian/99-gce.rules:
43@@ -15,6 +27,17 @@ gce-compute-image-packages (20230808.00-0ubuntu1~22.04.0) jammy; urgency=medium
44
45 -- Utkarsh Gupta <utkarsh@ubuntu.com> Tue, 12 Sep 2023 14:48:13 +0530
46
47+gce-compute-image-packages (20230808.00-0ubuntu2) noble; urgency=medium
48+
49+ * debian/99-gce.rules:
50+ * The previous rule forced an I/O scheduler on all disk types. This
51+ has now been re-scoped to only affect HDDs.
52+ * The I/O scheduler has also been changed from "NOOP" to "NONE"
53+ which performed much better in testing.
54+ * LP: #2045708.
55+
56+ -- Chloé 'kajiya' Smith <chloe.smith@canonical.com> Mon, 16 Oct 2023 22:59:06 +0100
57+
58 gce-compute-image-packages (20230808.00-0ubuntu1) mantic; urgency=medium
59
60 * New upstream version 20230808.00. (LP: #2033061)
61diff --git a/src/lib/udev/google_nvme_id b/src/lib/udev/google_nvme_id
62index ef02963..f0bba67 100755
63--- a/src/lib/udev/google_nvme_id
64+++ b/src/lib/udev/google_nvme_id
65@@ -69,7 +69,7 @@ function get_namespace_device_name() {
66 fi
67
68 local device_name
69- device_name="$(echo "$nvme_json" | grep device_name | sed -e 's/.*"device_name":[ \t]*"\([a-zA-Z0-9_-]\+\)".*/\1/')"
70+ device_name="$(echo "$nvme_json" | grep device_name | sed -e 's/.*"device_name":[ \t]*"\([.a-zA-Z0-9_-]\+\)".*/\1/')"
71
72 # Error if our device name is empty
73 if [[ -z "$device_name" ]]; then
74diff --git a/src/usr/bin/google_set_hostname b/src/usr/bin/google_set_hostname
75index 317768f..05a0412 100755
76--- a/src/usr/bin/google_set_hostname
77+++ b/src/usr/bin/google_set_hostname
78@@ -62,7 +62,8 @@ if [ -n "$new_host_name" ] && [ "${new_host_name%%.*}" != "$old_hostname" ] && !
79 # Restart rsyslog to update the hostname.
80 systemctl=$(which systemctl 2> /dev/null)
81 if [ -x "$systemctl" ]; then
82- hasrsyslog=$($systemctl | grep rsyslog | cut -f1 -d' ')
83+ # See man 5 systemd.unit for systemd unit naming rules
84+ hasrsyslog=$($systemctl | grep rsyslog | grep -oE '[a-zA-Z0-9:-_.\]+\.(service|socket|device|mount|automount|swap|target|path|timer|slice|scope)')
85 if [ ! -z "$hasrsyslog" ]; then
86 $systemctl -q --no-block restart "$hasrsyslog"
87 fi
88diff --git a/src/usr/bin/google_set_multiqueue b/src/usr/bin/google_set_multiqueue
89index fa87a1e..8e51934 100755
90--- a/src/usr/bin/google_set_multiqueue
91+++ b/src/usr/bin/google_set_multiqueue
92@@ -45,7 +45,7 @@ function set_channels() {
93
94 function set_irq_range() {
95 local -r nic="$1"
96- local core="$2"
97+ local bind_cores_begin="$2"
98
99 # The user may not have this $nic configured on their VM, if not, just skip
100 # it, no need to error out.
101@@ -53,16 +53,26 @@ function set_irq_range() {
102 return;
103 fi
104
105+
106 # We count the number of rx queues and assume number of rx queues == tx
107- # queues. Currently the GVE configuration at boot is 16 rx + 16 tx.
108+ # queues. The number of queues shown in the sysfs stands for the initial
109+ # queues while the number of IRQs stands for the max queues. The number of
110+ # initial queues should be always less than or equal to that of the max
111+ # queues.
112+ core=$bind_cores_begin
113+ num_irqs=$(( $(ls /sys/class/net/"$nic"/device/msi_irqs | wc -l) / 2 ))
114 num_q=$(ls -1 /sys/class/net/"$nic"/queues/ | grep rx | wc -l)
115
116 echo "Setting irq binding for "$nic" to core [$core - $((core + num_q - 1))] ..."
117
118 irqs=($(ls /sys/class/net/"$nic"/device/msi_irqs | sort -g))
119- for ((queue = 0; queue < "$num_q"; queue++)); do
120- tx_irq=${irqs[$queue]}
121- rx_irq=${irqs[$((queue + num_q))]}
122+ for ((irq = 0; irq < "$num_irqs"; irq++)); do
123+ tx_irq=${irqs[$irq]}
124+ rx_irq=${irqs[$((irq + num_irqs))]}
125+
126+ # Only allocate $num_q cores to the IRQs and queues. If the number of IRQs
127+ # is more than that of queues, the CPUs will be wrapped around.
128+ core=$(( bind_cores_begin + irq % num_q ))
129
130 # this is GVE's TX irq. See gve_tx_idx_to_ntfy().
131 echo "$core" > /proc/irq/"$tx_irq"/smp_affinity_list
132@@ -70,23 +80,32 @@ function set_irq_range() {
133 # this is GVE's RX irq. See gve_rx_idx_to_ntfy().
134 echo "$core" > /proc/irq/"$rx_irq"/smp_affinity_list
135
136- # XPS (Transmit Packet Steering) allows a core to decide which queue to
137- # select if its mask is found in one of the queue's xps_cpus
138- cp /proc/irq/"$tx_irq"/smp_affinity /sys/class/net/"$nic"/queues/tx-"$queue"/xps_cpus
139-
140- echo -en "$nic:q-$queue: \ttx: irq $tx_irq bind to $core \trx: irq $rx_irq bind to $core"
141- echo -e " \txps_cpus bind to $(cat /sys/class/net/"$nic"/queues/tx-"$queue"/xps_cpus)"
142+ # Check if the queue exists at present because the number of IRQs equals
143+ # the max number of queues allocated and could be greater than the current
144+ # number of queues.
145+ tx_queue=/sys/class/net/"$nic"/queues/tx-"$irq"
146+ if ls $tx_queue 1> /dev/null 2>&1; then
147+ # XPS (Transmit Packet Steering) allows a core to decide which queue to
148+ # select if its mask is found in one of the queue's xps_cpus
149+ cp /proc/irq/"$tx_irq"/smp_affinity $tx_queue/xps_cpus
150+
151+ echo -en "$nic:q-$irq: \ttx: irq $tx_irq bind to $core \trx: irq $rx_irq bind to $core"
152+ echo -e " \txps_cpus bind to $(cat $tx_queue/xps_cpus)"
153+ else
154+ echo -e "$nic:q-$irq: \ttx: irq $tx_irq bind to $core \trx: irq $rx_irq bind to $core"
155+ fi
156
157- core=$((core + 1))
158 done
159 }
160
161-# returns 0 (success) if it's running on a3 platform.
162+# returns 0 (success) if it's running on a3 or a3plus platform.
163 function is_a3_platform() {
164- machine_type=$(curl -H "Metadata-Flavor: Google" \
165+ machine_type=$(curl -m 1 -H "Metadata-Flavor: Google" \
166 http://169.254.169.254/computeMetadata/v1/instance/machine-type)
167
168- [[ "$machine_type" == *"a3-highgpu-8g"* ]] || return 1
169+ [[ "$machine_type" == *"a3-highgpu-8g"* \
170+ || "$machine_type" == *"a3-ultragpu-8g"* \
171+ || "$machine_type" == *"a3-megagpu-8g"* ]] || return 1
172
173 return 0
174 }
175@@ -234,7 +253,7 @@ fi
176
177 # IRQ binding for numa 0, CPUs [0, 51] and [104, 155] are for numa 0.
178 numa0_irq_start=1
179-find /sys/class/net -type l | xargs -L 1 realpath | sort | xargs -L 1 basename | grep -v lo | while read nic_name; do
180+find /sys/class/net -type l | xargs -L 1 realpath | grep '/sys/devices/pci' | sort | xargs -L 1 basename | while read nic_name; do
181 nic_numa_node=$(cat /sys/class/net/"$nic_name"/device/numa_node)
182 if [[ $nic_numa_node -ne 0 ]]; then
183 continue
184@@ -256,7 +275,7 @@ done
185
186 # IRQ binding for numa 1, CPUs [52, 103] and [156, 207] are for numa 1.
187 numa1_irq_start=52
188-find /sys/class/net -type l | xargs -L 1 realpath | sort | xargs -L 1 basename | grep -v lo | while read nic_name; do
189+find /sys/class/net -type l | xargs -L 1 realpath | grep '/sys/devices/pci' | sort | xargs -L 1 basename | while read nic_name; do
190 nic_numa_node=$(cat /sys/class/net/"$nic_name"/device/numa_node)
191 if [[ $nic_numa_node -ne 1 ]]; then
192 continue

Subscribers

People subscribed via source and target branches