Skip to contentSkip to conversation

kernel: event: core: Change return type to vm_fault_t

PATCH In review Souptick Joarder 2 participants 6 messages Apr 14, 2018 – May 17, 2018 perf events

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kernel: event: core: Change return type to vm_fault_t

Use new return type vm_fault_t for fault handler and page_mkwrite handler in struct vm_operations_struct.

---
 kernel/events/core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/events/core.c +2 -2
index 96db9ae..d09f1c4 100644
@@ -4918,11 +4918,11 @@ void perf_event_update_userpage(struct perf_event *event)
 }
 EXPORT_SYMBOL_GPL(perf_event_update_userpage);
 
-static int perf_mmap_fault(struct vm_fault *vmf)
+static vm_fault_t perf_mmap_fault(struct vm_fault *vmf)
 {
 	struct perf_event *event = vmf->vma->vm_file->private_data;
 	struct ring_buffer *rb;
-	int ret = VM_FAULT_SIGBUS;
+	vm_fault_t ret = VM_FAULT_SIGBUS;
 
 	if (vmf->flags & FAULT_FLAG_MKWRITE) {
 		if (vmf->pgoff == 0)

--
1.9.1

maintainer
#1 lore raw
Quoted 14 lines · Souptick Joarder

Use new return type vm_fault_t for fault handler and page_mkwrite handler in struct vm_operations_struct.

---
 kernel/events/core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/events/core.c +0 -0
index 96db9ae..d09f1c4 100644

kernel/events/core.c void perf_event_update_userpage(struct perf_event *event) · line 4921

Quoted 5 lines
kernel/events/core.c +1 -1
@@ -4918,11 +4918,11 @@ void perf_event_update_userpage(struct perf_event *event)
 }
 EXPORT_SYMBOL_GPL(perf_event_update_userpage);
 
-static int perf_mmap_fault(struct vm_fault *vmf)
+static vm_fault_t perf_mmap_fault(struct vm_fault *vmf)

I'm fine with the patch, but shouldn't this be part of a larger series / cocinelle script?

Even if not everything that has a (struct vm_fault *) argument is a fault handler, you could still match on the function being assigned to vm_operations_struct::fault.

So ACK on the patch, but please don't do this with a slow trickle of individual patches.

#2 lore raw
Quoted 3 lines

I'm fine with the patch, but shouldn't this be part of a larger series / cocinelle script?

This one is trivial but many others are not. As part of this clean up we have fixed many existing bugs in fault handlers of drivers/ file systems. Also we are replacing existing vm_insert_foo() with new vmf_insert_foo() in fault handlers (wherever applicable). Refer - 1c8f422059ae5da07db7406ab916203f9417e396 in 4.17-rc1

#3 lore raw
Quoted 4 lines · Souptick Joarder
Quoted 3 lines

I'm fine with the patch, but shouldn't this be part of a larger series / cocinelle script?

Quoted 8 lines

This one is trivial but many others are not. As part of this clean up we have fixed many existing bugs in fault handlers of drivers/ file systems. Also we are replacing existing vm_insert_foo() with new vmf_insert_foo() in fault handlers (wherever applicable). Refer - 1c8f422059ae5da07db7406ab916203f9417e396 in 4.17-rc1

Any further comment on this patch ?

#4 lore raw
Quoted 14 lines · Souptick Joarder
Quoted 4 lines · Souptick Joarder
Quoted 3 lines

I'm fine with the patch, but shouldn't this be part of a larger series / cocinelle script?

Quoted 8 lines

This one is trivial but many others are not. As part of this clean up we have fixed many existing bugs in fault handlers of drivers/ file systems. Also we are replacing existing vm_insert_foo() with new vmf_insert_foo() in fault handlers (wherever applicable). Refer - 1c8f422059ae5da07db7406ab916203f9417e396 in 4.17-rc1

Quoted 1 line

Any further comment on this patch ?

Peter, if no further comment, we would like to get this patch in queue for 4.18.

maintainer Acked-by
#5 lore raw
Quoted 15 lines · Souptick Joarder
Quoted 14 lines · Souptick Joarder
Quoted 12 lines · Souptick Joarder
Quoted 3 lines

I'm fine with the patch, but shouldn't this be part of a larger series / cocinelle script?

This one is trivial but many others are not. As part of this clean up we have fixed many existing bugs in fault handlers of drivers/ file systems. Also we are replacing existing vm_insert_foo() with new vmf_insert_foo() in fault handlers (wherever applicable). Refer - 1c8f422059ae5da07db7406ab916203f9417e396 in 4.17-rc1

Quoted 4 lines
Quoted 1 line

Any further comment on this patch ?

Peter, if no further comment, we would like to get this patch in queue for 4.18.

Nah, I still think you're doing this wrong by trickling single patches, but have at.