Skip to contentSkip to conversation

fs-proc-kcore-use-page_offline_freezethaw.patch removed from -mm tree

merged [email protected] 1 participant 1 message Jul 6, 2021

lore
Share & tools
lore

[email protected]

author tree notice Applied
#0 lore raw

The patch titled
Subject: fs/proc/kcore: use page_offline_(freeze|thaw)
has been removed from the -mm tree. Its filename was
fs-proc-kcore-use-page_offline_freezethaw.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
From: David Hildenbrand <[email protected]>
Subject: fs/proc/kcore: use page_offline_(freeze|thaw)

Let's properly synchronize with drivers that set PageOffline(). Unfreeze/thaw every now and then, so drivers that want to set PageOffline() can make progress.

Cc Aili Yao <[email protected]>
Cc Alexey Dobriyan <[email protected]>
Cc Alex Shi <[email protected]>
Cc Haiyang Zhang <[email protected]>
Cc Jason Wang <[email protected]>
Cc Jiri Bohac <[email protected]>
Cc "K. Y. Srinivasan" <[email protected]>
Cc "Matthew Wilcox (Oracle)" <[email protected]>
Cc "Michael S. Tsirkin" <[email protected]>
Cc Michal Hocko <[email protected]>
Cc Mike Kravetz <[email protected]>
Cc Naoya Horiguchi <[email protected]>
Cc Roman Gushchin <[email protected]>
Cc Stephen Hemminger <[email protected]>
Cc Steven Price <[email protected]>
Cc Wei Liu <[email protected]>

---

 fs/proc/kcore.c |   13 +++++++++++++
 1 file changed, 13 insertions(+)
fs/proc/kcore.c renamed from fs/proc/kcore.c~fs-proc-kcore-use-page_offline_freezethaw +13 -0
@@ -313,6 +313,7 @@ read_kcore(struct file *file, char __use
 {
 	char *buf = file->private_data;
 	size_t phdrs_offset, notes_offset, data_offset;
+	size_t page_offline_frozen = 1;
 	size_t phdrs_len, notes_len;
 	struct kcore_list *m;
 	size_t tsz;
@@ -322,6 +323,11 @@ read_kcore(struct file *file, char __use
 	int ret = 0;
 
 	down_read(&kclist_lock);
+	/*
+	 * Don't race against drivers that set PageOffline() and expect no
+	 * further page access.
+	 */
+	page_offline_freeze();
 
 	get_kcore_size(&nphdr, &phdrs_len, &notes_len, &data_offset);
 	phdrs_offset = sizeof(struct elfhdr);
@@ -480,6 +486,12 @@ read_kcore(struct file *file, char __use
 			}
 		}
 
+		if (page_offline_frozen++ % MAX_ORDER_NR_PAGES == 0) {
+			page_offline_thaw();
+			cond_resched();
+			page_offline_freeze();
+		}
+
 		if (&m->list == &kclist_head) {
 			if (clear_user(buffer, tsz)) {
 				ret = -EFAULT;
@@ -565,6 +577,7 @@ skip:
 	}
 
 out:
+	page_offline_thaw();
 	up_read(&kclist_lock);
 	if (ret)
 		return ret;

_

Patches currently in -mm which might be from [email protected] are

memory-hotplugrst-complete-admin-guide-overhaul.patch