From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 80DFDC433DB for ; Tue, 23 Mar 2021 08:27:47 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id EB50B619B9 for ; Tue, 23 Mar 2021 08:27:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EB50B619B9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.ibm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 662316B012D; Tue, 23 Mar 2021 04:27:46 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5EA5C6B012F; Tue, 23 Mar 2021 04:27:46 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 467356B0131; Tue, 23 Mar 2021 04:27:46 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0251.hostedemail.com [216.40.44.251]) by kanga.kvack.org (Postfix) with ESMTP id 240516B012D for ; Tue, 23 Mar 2021 04:27:46 -0400 (EDT) Received: from smtpin05.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id DCE96440E for ; Tue, 23 Mar 2021 08:27:45 +0000 (UTC) X-FDA: 77950460490.05.7A193DE Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by imf15.hostedemail.com (Postfix) with ESMTP id C1580A0009E3 for ; Tue, 23 Mar 2021 08:27:43 +0000 (UTC) Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 12N84K52024266; Tue, 23 Mar 2021 04:27:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=pp1; bh=LUgqbQvwR+sfvIaSMzft1kWLvPHosRvGCoObmhMnUQI=; b=qFGu+AfuXUtFzCsz3Byw9cxakJDw09yyFf7HfvGRn6NiouNUxMVdqcJ0bVCLDdW7Uux/ QNDUKrloYEVyBN/zasCuBi999pHHPIv6rhrToZFHZOSBLtERt6tKefKsaboI322W/Ufq QIMsHeidwaqIxh66mgYlC7BJWumgs5BlNhy4avIZmkSS3tVyNqiH8VmjCJ81KfjX4X1n c0cZrl2QtegzfOBWxMuyecu7W/kx2NtB8wLooM2gd17vCH3gKp/i6V1+VhdBkURSCsDz aQ9+nahI39S3qax8rllWWoeGOk62KgTddqiBZoQFufzAivWVvN9bFakYFNuILAErwvFX EQ== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 37dxjwk124-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 23 Mar 2021 04:27:43 -0400 Received: from m0098409.ppops.net (m0098409.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 12N85ZGS029957; Tue, 23 Mar 2021 04:27:43 -0400 Received: from ppma06fra.de.ibm.com (48.49.7a9f.ip4.static.sl-reverse.com [159.122.73.72]) by mx0a-001b2d01.pphosted.com with ESMTP id 37dxjwk111-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 23 Mar 2021 04:27:42 -0400 Received: from pps.filterd (ppma06fra.de.ibm.com [127.0.0.1]) by ppma06fra.de.ibm.com (8.16.0.43/8.16.0.43) with SMTP id 12N8RLdn001885; Tue, 23 Mar 2021 08:27:40 GMT Received: from b06avi18626390.portsmouth.uk.ibm.com (b06avi18626390.portsmouth.uk.ibm.com [9.149.26.192]) by ppma06fra.de.ibm.com with ESMTP id 37d9a61mrh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 23 Mar 2021 08:27:40 +0000 Received: from b06wcsmtp001.portsmouth.uk.ibm.com (b06wcsmtp001.portsmouth.uk.ibm.com [9.149.105.160]) by b06avi18626390.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 12N8RJAX36372978 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 23 Mar 2021 08:27:20 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BBBCBA405B; Tue, 23 Mar 2021 08:27:37 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7700DA405C; Tue, 23 Mar 2021 08:27:36 +0000 (GMT) Received: from linux.ibm.com (unknown [9.145.165.64]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Tue, 23 Mar 2021 08:27:36 +0000 (GMT) Date: Tue, 23 Mar 2021 10:27:34 +0200 From: Mike Rapoport To: Peter Xu Cc: linux-man@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Andrea Arcangeli , Mike Rapoport , Axel Rasmussen , Alejandro Colomar , Michael Kerrisk , Nadav Amit , Andrew Morton Subject: Re: [PATCH v4 1/4] userfaultfd.2: Add UFFD_FEATURE_THREAD_ID docs Message-ID: References: <20210322220848.52162-1-peterx@redhat.com> <20210322220848.52162-2-peterx@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210322220848.52162-2-peterx@redhat.com> X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.369,18.0.761 definitions=2021-03-23_02:2021-03-22,2021-03-23 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=999 spamscore=0 impostorscore=0 phishscore=0 adultscore=0 lowpriorityscore=0 suspectscore=0 malwarescore=0 mlxscore=0 bulkscore=0 priorityscore=1501 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2103230057 X-Stat-Signature: 1xhdpzgcn6qfoqp3j8yesze8c6fixi34 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: C1580A0009E3 Received-SPF: none (linux.ibm.com>: No applicable sender policy available) receiver=imf15; identity=mailfrom; envelope-from=""; helo=mx0a-001b2d01.pphosted.com; client-ip=148.163.156.1 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1616488063-87484 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon, Mar 22, 2021 at 06:08:45PM -0400, Peter Xu wrote: > UFFD_FEATURE_THREAD_ID is supported since Linux 4.14. > > Signed-off-by: Peter Xu > --- > man2/userfaultfd.2 | 13 +++++++++++++ > 1 file changed, 13 insertions(+) > > diff --git a/man2/userfaultfd.2 b/man2/userfaultfd.2 > index e7dc9f813..555e37409 100644 > --- a/man2/userfaultfd.2 > +++ b/man2/userfaultfd.2 > @@ -77,6 +77,13 @@ When the last file descriptor referring to a userfaultfd object is closed, > all memory ranges that were registered with the object are unregistered > and unread events are flushed. > .\" > +.PP > +Since Linux 4.14, userfaultfd page fault message can selectively embed faulting > +thread ID information into the fault message. > +One needs to enable this feature explicitly using the > +.BR UFFD_FEATURE_THREAD_ID > +feature bit when initializing the userfaultfd context. > +By default, thread ID reporting is diabled. ^ disabled :) > .SS Usage > The userfaultfd mechanism is designed to allow a thread in a multithreaded > program to perform user-space paging for the other threads in the process. > @@ -229,6 +236,9 @@ struct uffd_msg { > struct { > __u64 flags; /* Flags describing fault */ > __u64 address; /* Faulting address */ > + union { > + __u32 ptid; /* Thread ID of the fault */ > + } feat; > } pagefault; > > struct { /* Since Linux 4.11 */ > @@ -358,6 +368,9 @@ otherwise it is a read fault. > .\" UFFD_PAGEFAULT_FLAG_WP is not yet supported. > .RE > .TP > +.I pagefault.feat.pid > +The thread ID that triggered the page fault. > +.TP > .I fork.ufd > The file descriptor associated with the userfault object > created for the child created by > -- > 2.26.2 > -- Sincerely yours, Mike.