Thread (67 messages) 67 messages, 9 authors, 2024-07-10

Re: [PATCH v2 01/12] uprobes: update outdated comment

From: Andrii Nakryiko <hidden>
Date: 2024-07-03 18:25:02
Also in: bpf

On Wed, Jul 3, 2024 at 4:40 AM Oleg Nesterov [off-list ref] wrote:
Sorry for the late reply. I'll try to read this version/discussion
when I have time... yes, I have already promised this before, sorry :/

On 07/01, Andrii Nakryiko wrote:
quoted
There is no task_struct passed into get_user_pages_remote() anymore,
drop the parts of comment mentioning NULL tsk, it's just confusing at
this point.
Agreed.
quoted
@@ -2030,10 +2030,8 @@ static int is_trap_at_addr(struct mm_struct *mm, unsigned long vaddr)
              goto out;

      /*
-      * The NULL 'tsk' here ensures that any faults that occur here
-      * will not be accounted to the task.  'mm' *is* current->mm,
-      * but we treat this as a 'remote' access since it is
-      * essentially a kernel access to the memory.
+      * 'mm' *is* current->mm, but we treat this as a 'remote' access since
+      * it is essentially a kernel access to the memory.
       */
      result = get_user_pages_remote(mm, vaddr, 1, FOLL_FORCE, &page, NULL);
OK, this makes it less confusing, so

Acked-by: Oleg Nesterov <oleg@redhat.com>


---------------------------------------------------------------------
but it still looks confusing to me. This code used to pass tsk = NULL
only to avoid tsk->maj/min_flt++ in faultin_page().

But today mm_account_fault() increments these counters without checking
FAULT_FLAG_REMOTE, mm == current->mm, so it seems it would be better to
just use get_user_pages() and remove this comment?
I don't know, it was a drive-by cleanup which I'm starting to regret already :)
Oleg.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help