From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id 1026F3858429 for ; Thu, 11 Aug 2022 10:23:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 1026F3858429 Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 27B9hExv021416 for ; Thu, 11 Aug 2022 10:23:27 GMT Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3hvycs18nd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 11 Aug 2022 10:23:27 +0000 Received: from m0098417.ppops.net (m0098417.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 27B9uw8n015909 for ; Thu, 11 Aug 2022 10:23:27 GMT Received: from ppma04ams.nl.ibm.com (63.31.33a9.ip4.static.sl-reverse.com [169.51.49.99]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3hvycs18mt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 11 Aug 2022 10:23:26 +0000 Received: from pps.filterd (ppma04ams.nl.ibm.com [127.0.0.1]) by ppma04ams.nl.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 27BAKoXW023517; Thu, 11 Aug 2022 10:23:25 GMT Received: from b06avi18878370.portsmouth.uk.ibm.com (b06avi18878370.portsmouth.uk.ibm.com [9.149.26.194]) by ppma04ams.nl.ibm.com with ESMTP id 3huww2hw2d-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 11 Aug 2022 10:23:25 +0000 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06avi18878370.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 27BANePn35258732 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 11 Aug 2022 10:23:40 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D186111C050; Thu, 11 Aug 2022 10:23:22 +0000 (GMT) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A96F011C04A; Thu, 11 Aug 2022 10:23:22 +0000 (GMT) Received: from [9.171.79.194] (unknown [9.171.79.194]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTP; Thu, 11 Aug 2022 10:23:22 +0000 (GMT) Message-ID: Date: Thu, 11 Aug 2022 12:23:22 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.12.0 Subject: Re: [PATCH] tst-process_madvise: Check process_madvise-syscall support. Content-Language: en-US To: Florian Weimer , Stefan Liebler via Libc-alpha References: <20220811074746.2882351-1-stli@linux.ibm.com> <87edxnuqf4.fsf@oldenburg.str.redhat.com> From: Stefan Liebler In-Reply-To: <87edxnuqf4.fsf@oldenburg.str.redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: i_lZiB4bIJZbwtB6ha_nneEHv4kg3hF2 X-Proofpoint-GUID: 11qu7Gin9K1ouk78tB2ewJgFeKgpVtGq X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.883,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-08-11_05,2022-08-11_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 spamscore=0 adultscore=0 mlxscore=0 clxscore=1015 priorityscore=1501 lowpriorityscore=0 mlxlogscore=999 impostorscore=0 phishscore=0 suspectscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2207270000 definitions=main-2208110028 X-Spam-Status: No, score=-12.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, NICE_REPLY_A, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Aug 2022 10:23:29 -0000 On 11/08/2022 10:37, Florian Weimer wrote: > * Stefan Liebler via Libc-alpha: > >> So far this test checks if pidfd_open-syscall is supported, >> which was introduced with linux 5.3. >> >> The process_madvise-syscall was introduced with linux 5.10. >> Thus you'll get FAILs if you are running a kernel in between. >> >> This patch adds a check if the first process_madvise-syscall >> returns ENOSYS and in this case will fail with UNSUPPORTED. >> --- >> sysdeps/unix/sysv/linux/tst-process_madvise.c | 8 ++++++-- >> 1 file changed, 6 insertions(+), 2 deletions(-) >> >> diff --git a/sysdeps/unix/sysv/linux/tst-process_madvise.c b/sysdeps/unix/sysv/linux/tst-process_madvise.c >> index a674e80b76..6fe5a79b1d 100644 >> --- a/sysdeps/unix/sysv/linux/tst-process_madvise.c >> +++ b/sysdeps/unix/sysv/linux/tst-process_madvise.c >> @@ -101,8 +101,12 @@ do_test (void) >> >> /* We expect this to succeed in the target process because the mapping >> is valid. */ >> - TEST_COMPARE (process_madvise (pidfd, &iv, 1, MADV_COLD, 0), >> - 2 * page_size); >> + errno = 0; >> + ssize_t ret = process_madvise (pidfd, &iv, 1, MADV_COLD, 0); >> + if (ret == -1 && errno == ENOSYS) >> + FAIL_UNSUPPORTED ("kernel does not support process_madvise, skipping" >> + "test"); >> + TEST_COMPARE (ret, 2 * page_size); >> } >> >> { > > Assigning 0 to errno should not be necessary here. But the patch looks > good otherwise. > > Reviewed-by: Florian Weimer > > Thanks, > Florian > Hi Florian, yes you are right. I've just committed it without the assignment. Thanks, Stefan