Skip to contentSkip to conversation

Fix: rcu: Remove wrapper definitions for obsolete RCU... (v5.1)

PATCH New Michael Jeanson 2 participants 5 messages Mar 18, 2019 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 2/5 Fix: rcu: Remove wrapper definitions for obsolete RCU... (v5.1)

See upstream commit :

commit 6ba7d681aca22e53385bdb35b1d7662e61905760

Author: Paul E. McKenney <[email protected]>
Date:   Wed Jan 9 15:22:03 2019 -0800

rcu: Remove wrapper definitions for obsolete RCU update functions

None of synchronize_rcu_bh, synchronize_rcu_bh_expedited, call_rcu_bh, rcu_barrier_bh, synchronize_sched, synchronize_sched_expedited, call_rcu_sched, rcu_barrier_sched, get_state_synchronize_sched, and cond_synchronize_sched are actually used. This commit therefore removes their trivial wrapper-function definitions.

---
 lttng-events.c | 5 +++++
 1 file changed, 5 insertions(+)
lttng-events.c +5 -0
index 566080a..f4206c5 100644
@@ -75,7 +75,12 @@ int _lttng_field_statedump(struct lttng_session *session,
 
 void synchronize_trace(void)
 {
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,1,0))
+	synchronize_rcu();
+#else
 	synchronize_sched();
+#endif
+
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
 #ifdef CONFIG_PREEMPT_RT_FULL
 	synchronize_rcu();
Signature · 1 line
2.17.1
#2 lore raw

PATCH 3/5 Fix: pipe: stop using ->can_merge (v5.1)

In reply to a message not in the archive

See upstream commit:

commit 01e7187b41191376cee8bea8de9f907b001e87b4
Author: Jann Horn <[email protected]>
Date: Wed Jan 23 15:19:18 2019 +0100

pipe: stop using ->can_merge

Al Viro pointed out that since there is only one pipe buffer type to which new data can be appended, it isn't necessary to have a ->can_merge field in struct pipe_buf_operations, we can just check for a magic type.

---
 lib/ringbuffer/ring_buffer_splice.c | 2 ++
 1 file changed, 2 insertions(+)
lib/ringbuffer/ring_buffer_splice.c +2 -0
index 468641b..52179a7 100644
@@ -43,7 +43,9 @@ static void lib_ring_buffer_pipe_buf_release(struct pipe_inode_info *pipe,
 }
 
 static const struct pipe_buf_operations ring_buffer_pipe_buf_ops = {
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5,1,0))
 	.can_merge = 0,
+#endif
 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,15,0))
 	.map = generic_pipe_buf_map,
 	.unmap = generic_pipe_buf_unmap,
Signature · 1 line
2.17.1
#3 lore raw

PATCH 4/5 Fix: Revert "KVM: MMU: show mmu_valid_gen..." (v5.1)

In reply to a message not in the archive

See upstream commit :

commit b59c4830ca185ba0e9f9e046fb1cd10a4a92627a
Author: Sean Christopherson <[email protected]>
Date: Tue Feb 5 13:01:30 2019 -0800

Revert "KVM: MMU: show mmu_valid_gen in shadow page related tracepoints"

...as part of removing x86 KVM's fast invalidate mechanism, i.e. this is one part of a revert all patches from the series that introduced the mechanism[1].

This reverts commit 2248b023219251908aedda0621251cffc548f258.

---
 .../events/lttng-module/arch/x86/kvm/mmutrace.h        | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
instrumentation/events/lttng-module/arch/x86/kvm/mmutrace.h +9 -1
index 39ec6a9..e25a774 100644
@@ -14,7 +14,15 @@
 #undef TRACE_SYSTEM
 #define TRACE_SYSTEM kvm_mmu
 
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,1,0))
+
+#define LTTNG_KVM_MMU_PAGE_FIELDS \
+	ctf_integer(__u64, gfn, (sp)->gfn) \
+	ctf_integer(__u32, role, (sp)->role.word) \
+	ctf_integer(__u32, root_count, (sp)->root_count) \
+	ctf_integer(bool, unsync, (sp)->unsync)
+
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0))
 
 #define LTTNG_KVM_MMU_PAGE_FIELDS \
 	ctf_integer(unsigned long, mmu_valid_gen, (sp)->mmu_valid_gen) \
Signature · 1 line
2.17.1
#4 lore raw

PATCH 5/5 Fix: atomic_long_add_unless() returns a boolean

In reply to a message not in the archive

Because of a documentation error in older kernels, it was assumed that atomic_long_add_unless would return the 'unless' value when it failed but the implementation actually returns a boolean.

Also add missing error code int 'ret' and compare against the right type max value.

---
 lttng-abi.c    | 7 +++----
 lttng-events.c | 4 ++--
 2 files changed, 5 insertions(+), 6 deletions(-)
lttng-abi.c +3 -4
index 0534472..ca94379 100644
@@ -419,8 +419,8 @@ int lttng_abi_create_channel(struct file *session_file,
 		transport_name = "<unknown>";
 		break;
 	}
-	if (atomic_long_add_unless(&session_file->f_count,
-		1, INT_MAX) == INT_MAX) {
+	if (!atomic_long_add_unless(&session_file->f_count, 1, LONG_MAX)) {
+		ret = -EOVERFLOW;
 		goto refcount_error;
 	}
 	/*
@@ -1072,8 +1072,7 @@ int lttng_abi_create_event(struct file *channel_file,
 		goto file_error;
 	}
 	/* The event holds a reference on the channel */
-	if (atomic_long_add_unless(&channel_file->f_count,
-		1, INT_MAX) == INT_MAX) {
+	if (!atomic_long_add_unless(&channel_file->f_count, 1, LONG_MAX)) {
 		ret = -EOVERFLOW;
 		goto refcount_error;
 	}
lttng-events.c +2 -2
index f4206c5..a4570b7 100644
@@ -1140,8 +1140,8 @@ int lttng_session_list_tracker_pids(struct lttng_session *session)
 		ret = PTR_ERR(tracker_pids_list_file);
 		goto file_error;
 	}
-	if (atomic_long_add_unless(&session->file->f_count,
-		1, INT_MAX) == INT_MAX) {
+	if (!atomic_long_add_unless(&session->file->f_count, 1, LONG_MAX)) {
+		ret = -EOVERFLOW;
 		goto refcount_error;
 	}
 	ret = lttng_tracker_pids_list_fops.open(NULL, tracker_pids_list_file);
Signature · 1 line
2.17.1
#5 lore raw

Re: [PATCH lttng-modules 1/5] Fix: mm: create the new vm_fault_t type (v5.1)

In reply to a message not in the archive

All merged into master, 2.11, 2.10, 2.9, thanks!

Mathieu

Quoted 59 lines · ----- On Mar 18, 2019, at 4:20 PM, Michael Jeanson [email protected] wrote:

See upstream commit:

commit 3d3539018d2cbd12e5af4a132636ee7fd8d43ef0
Author: Souptick Joarder <[email protected]>
Date: Thu Mar 7 16:31:14 2019 -0800

mm: create the new vm_fault_t type

Page fault handlers are supposed to return VM_FAULT codes, but some drivers/file systems mistakenly return error numbers. Now that all drivers/file systems have been converted to use the vm_fault_t return type, change the type definition to no longer be compatible with 'int'. By making it an unsigned int, the function prototype becomes incompatible with a function which returns int. Sparse will detect any attempts to return a value which is not a VM_FAULT code.

VM_FAULT_SET_HINDEX and VM_FAULT_GET_HINDEX values are changed to avoid conflict with other VM_FAULT codes.
---
lib/ringbuffer/ring_buffer_mmap.c | 12 +++++++++++-

1 file changed, 11 insertions(+), 1 deletion(-)
lib/ringbuffer/ring_buffer_mmap.c +3 -0
index 30dd93e..fab9458 100644
@@ -20,7 +20,11 @@
 /*
 * fault() vm_op implementation for ring buffer file mapping.
 */
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,1,0))
+static vm_fault_t lib_ring_buffer_fault_compat(struct vm_area_struct *vma,
 struct vm_fault *vmf)
+#else

static int lib_ring_buffer_fault_compat(struct vm_area_struct *vma, struct vm_fault *vmf)
+#endif

{
	struct lib_ring_buffer *buf = vma->vm_private_data;
	struct channel *chan = buf->backend.chan;
lib/ringbuffer/ring_buffer_mmap.c +7 -1
@@ -53,7 +57,13 @@ static int lib_ring_buffer_fault_compat(struct vm_area_struct
 *vma, struct vm_fa
 	return 0;
 }
 
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,1,0))
+static vm_fault_t lib_ring_buffer_fault(struct vm_fault *vmf)
+{
+	struct vm_area_struct *vma = vmf->vma;
+	return lib_ring_buffer_fault_compat(vma, vmf);
+}
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0))
 static int lib_ring_buffer_fault(struct vm_fault *vmf)
 {
	struct vm_area_struct *vma = vmf->vma;

--
2.17.1

Signature · 3 lines
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com