Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp4534913imm; Mon, 30 Jul 2018 17:03:50 -0700 (PDT) X-Google-Smtp-Source: AAOMgpc5HGwfmxXBeBR9Hg7d8yCMrCewghZ2i2vXP0494AoNpE+X/jdqOzkr4MCMqWThZtucf6hG X-Received: by 2002:a17:902:1d4a:: with SMTP id u10-v6mr18468052plu.267.1532995430325; Mon, 30 Jul 2018 17:03:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532995430; cv=none; d=google.com; s=arc-20160816; b=iiDOPHfugAqJGcMlIC/EC8fKWjudq8CDGFdLAEHh++a4LZskgU07a1Ksk4NcBopz7S YW+YssKlfBNzXy+CWaXEpwXAX9DsbrsOTYu6dRRcT+kQjISPhBnmtuLaJzr+UXTXqHb/ f4Aw+jM96wU4YNy22etYsYi3Qy0Ckf2ro90PLfj70e7bbiFMh19k+C/0iphAxyaJTfp3 VRvbV30cr12t4PV4Fg9VBpXi3LECpXI7B/mUEw+U5lRerZuhcKhcrHgAGduPlahkDeRp Z/pbeWm5SMbk4fIOCJ16Uwh0ndx1pdcKakeWfVm1XPtHlvXQR18m93ng9uRzlGBZbPjY Ln+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:mime-version:date:in-reply-to :subject:cc:to:from:user-agent:references:arc-authentication-results; bh=gVb1d6EEfMUsLWe9aS3seb6prVnMDNxLbLYGNsxu6SM=; b=hNTZ6L48s/5WhcjLilQO8EG2S2aV0lCj9SPOeM0nRL80Eyakh5KZAVkwTOoPQsFKds I0y093T8kgJSwRyw00Xo8AB+NU5drOiitM2A4fTrc12ihkpTw4tJoaMA9x5Fglt3DTbr YXsi1QFfrr5zCA3BYmUdmormmA8tLEfpO7Q0JgVOF0RlfmaJRTytnUwhZGMIIVjzQqn/ gBcvfJG1CBKLEHl6CXxwuo/gRIzW7dS/Lw7Yop8klAc2tpzKomRFZIDVEz7hW5fLnqSz Da0wX1/o6+V0KNZ866bza2WWzkvG19PDEybLEMqo3dbXOxVvlBVDvmE9RdwF+n+x7cAw 1yYQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b22-v6si1381226pls.127.2018.07.30.17.03.35; Mon, 30 Jul 2018 17:03:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732095AbeGaBji (ORCPT + 99 others); Mon, 30 Jul 2018 21:39:38 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:56478 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729477AbeGaBji (ORCPT ); Mon, 30 Jul 2018 21:39:38 -0400 Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w6UNxJin049610 for ; Mon, 30 Jul 2018 20:02:11 -0400 Received: from e34.co.us.ibm.com (e34.co.us.ibm.com [32.97.110.152]) by mx0b-001b2d01.pphosted.com with ESMTP id 2kj97w73b9-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 30 Jul 2018 20:02:11 -0400 Received: from localhost by e34.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 30 Jul 2018 18:02:10 -0600 Received: from b03cxnp08028.gho.boulder.ibm.com (9.17.130.20) by e34.co.us.ibm.com (192.168.1.134) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Mon, 30 Jul 2018 18:02:07 -0600 Received: from b03ledav006.gho.boulder.ibm.com (b03ledav006.gho.boulder.ibm.com [9.17.130.237]) by b03cxnp08028.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w6V026dU62521374 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 30 Jul 2018 17:02:06 -0700 Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5064DC605D; Mon, 30 Jul 2018 18:02:06 -0600 (MDT) Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3DF78C6062; Mon, 30 Jul 2018 18:02:03 -0600 (MDT) Received: from morokweng.localdomain (unknown [9.85.203.167]) by b03ledav006.gho.boulder.ibm.com (Postfix) with ESMTPS; Mon, 30 Jul 2018 18:02:02 -0600 (MDT) References: <20180725024209.32586-1-bauerman@linux.ibm.com> <20180725024209.32586-4-bauerman@linux.ibm.com> <20180725141849.GE25188@rapoport-lnx> User-agent: mu4e 1.0; emacs 25.3.1 From: Thiago Jung Bauermann To: Mike Rapoport Cc: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Shuah Khan , Andrea Arcangeli , Prakash Sangappa Subject: Re: [PATCH 3/3] userfaultfd: selftest: Report XFAIL if shmem doesn't support zeropage In-reply-to: <20180725141849.GE25188@rapoport-lnx> Date: Mon, 30 Jul 2018 21:01:56 -0300 MIME-Version: 1.0 Content-Type: text/plain X-TM-AS-GCONF: 00 x-cbid: 18073100-0016-0000-0000-0000090FEAFD X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00009459; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000266; SDB=6.01068253; UDB=6.00549142; IPR=6.00846386; MB=3.00022414; MTD=3.00000008; XFM=3.00000015; UTC=2018-07-31 00:02:08 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18073100-0017-0000-0000-00003FD19783 Message-Id: <87zhy89ssr.fsf@morokweng.localdomain> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-07-30_10:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1806210000 definitions=main-1807300251 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Mike Rapoport writes: > Hi, > > On Tue, Jul 24, 2018 at 11:42:09PM -0300, Thiago Jung Bauermann wrote: >> If userfaultfd runs on a system that doesn't support UFFDIO_ZEROPAGE for >> shared memory, it currently ends with error code 1 which indicates test >> failure: >> >> # ./userfaultfd shmem 10 10 >> nr_pages: 160, nr_pages_per_cpu: 80 >> bounces: 9, mode: rnd poll, unexpected missing ioctl for anon memory >> # echo $? >> 1 >> >> This is a real failure, but expected so signal that to the test harness: > > I don't think its a real failure. If the kernel does not support > UFFDIO_ZEROPAGE for shared memory the userfaultfd_zeropage_test can be > simply skipped. Ok, good point. I'll make that change in v2. >> # ./userfaultfd shmem 10 10 >> nr_pages: 160, nr_pages_per_cpu: 80 >> bounces: 9, mode: rnd poll, UFFDIO_ZEROPAGE unsupported in shmem VMAs >> # echo $? >> 2 >> >> Signed-off-by: Thiago Jung Bauermann >> --- >> tools/testing/selftests/vm/userfaultfd.c | 8 ++++++++ >> 1 file changed, 8 insertions(+) >> >> diff --git a/tools/testing/selftests/vm/userfaultfd.c b/tools/testing/selftests/vm/userfaultfd.c >> index bc9ec38fbc34..686fe96f617f 100644 >> --- a/tools/testing/selftests/vm/userfaultfd.c >> +++ b/tools/testing/selftests/vm/userfaultfd.c >> @@ -1115,6 +1115,14 @@ static int userfaultfd_stress(void) >> expected_ioctls = uffd_test_ops->expected_ioctls; >> if ((uffdio_register.ioctls & expected_ioctls) != >> expected_ioctls) { >> + if (test_type == TEST_SHMEM && >> + (uffdio_register.ioctls & expected_ioctls) == >> + UFFD_API_RANGE_IOCTLS_BASIC) { >> + fprintf(stderr, >> + "UFFDIO_ZEROPAGE unsupported in shmem VMAs\n"); >> + return KSFT_XFAIL; >> + } >> + > > By all means, this check should be moved to userfaultfd_zeropage_test(). I made that change in v2. > Ideally, we should call here ksft_test_result_skip() and simply return from > the function. In my understanding, calling ksft_test_result_skip() would require converting the testcase to use the functions that generate TAP output. Also, returning here isn't actually necessary: from my testing userfaultfd_stress() doesn't require zeropage support in shmem so if the only bit missing from uffdio_register.ioctls is the one for UFFDIO_ZEROPAGE then this error can simply be ignored and the test can continue. Do you agree? >> fprintf(stderr, >> "unexpected missing ioctl for anon memory\n"); >> return 1; -- Thiago Jung Bauermann IBM Linux Technology Center