Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp4528827imm; Mon, 30 Jul 2018 16:56:32 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeNJk84Fb6yGVIsP7Nx72I6SK2xd5LlnQVvRplq30Yocn9RjAP9NVescoAIR0VVMPPstmpw X-Received: by 2002:a63:220d:: with SMTP id i13-v6mr18520701pgi.212.1532994992214; Mon, 30 Jul 2018 16:56:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532994992; cv=none; d=google.com; s=arc-20160816; b=MLDjBzvrHfRd1wFbfmMHr/Bbi+PVrM02pb0kK7JxTI6kGTWNYTzq/hPB7BjXvQB9p8 MOj8oKhcnOrrCvP58QSggboMFL12kotbc2fm0yztGxaZjh1yaXL4Pnj49xrB2VVBpmON HfZY49c9PbVCLZTu+i3281VKGnxjRdWTXQirYjEwtUpvuWR3JIp9N6zU0Lz6rGkK9Pwq Et0Vi/FvNo/DjsyrO2Ib69oTDcbQsVo/J08xiPMfeuw0AfKeaiBwO/71OD46R72sH7ev wiaL+7bOy8QG2S04tLilfkaCvlsk/jwWRjTCnEhSV05tcijrD6qIhSLVKZ8GrKw4l1hS Ht8w== 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=wVIJ6VxqyFJ/3j1oqdLwObUYfTloWCuF6tllIYy1ZvA=; b=QYQXat9Ao7XRbp7F045UCouydMnS9nzRnQPQEkZwWm541guj2lZ8sxL4S77BtuGBAB zCVNGuOpPBKJ7rB5nlxk7SSigWb6byF4gJ575LmFQ7B/ZlTkXuiCNpoNb/GnSj9v9AZ0 +bJxvcyPzkAAbgISB9rNKCjZC7o1b4Ntk1iKls51hoxx5MdgNjEOg0Edgokbw0CmOQiE M6x0VACwDeDFKwWUIAl4SoNDPSfYek8vEwcwvulcZvyXebxwisjQraDLVztVdWPJ1yb6 KP+2ErHsAH5KUc2PBPEp3zVoR1z2C9uY6CU2ogf6QTFZAcklHPqC/j8B7r8yJwkdmJtG xunw== 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.16.56.17; Mon, 30 Jul 2018 16:56:32 -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 S1732074AbeGaBcv (ORCPT + 99 others); Mon, 30 Jul 2018 21:32:51 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:58740 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731406AbeGaBcu (ORCPT ); Mon, 30 Jul 2018 21:32:50 -0400 Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w6UNri0t074153 for ; Mon, 30 Jul 2018 19:55:25 -0400 Received: from e32.co.us.ibm.com (e32.co.us.ibm.com [32.97.110.150]) by mx0b-001b2d01.pphosted.com with ESMTP id 2kjavhud0x-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 30 Jul 2018 19:55:24 -0400 Received: from localhost by e32.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 30 Jul 2018 17:55:24 -0600 Received: from b03cxnp08028.gho.boulder.ibm.com (9.17.130.20) by e32.co.us.ibm.com (192.168.1.132) 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 17:55:21 -0600 Received: from b03ledav004.gho.boulder.ibm.com (b03ledav004.gho.boulder.ibm.com [9.17.130.235]) by b03cxnp08028.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w6UNtKeo3146234 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 30 Jul 2018 16:55:20 -0700 Received: from b03ledav004.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 358B47805F; Mon, 30 Jul 2018 17:55:20 -0600 (MDT) Received: from b03ledav004.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 319757805E; Mon, 30 Jul 2018 17:55:16 -0600 (MDT) Received: from morokweng.localdomain (unknown [9.85.203.167]) by b03ledav004.gho.boulder.ibm.com (Postfix) with ESMTPS; Mon, 30 Jul 2018 17:55:12 -0600 (MDT) References: <20180725024209.32586-1-bauerman@linux.ibm.com> <20180725024209.32586-3-bauerman@linux.ibm.com> <20180725141148.GD25188@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 2/3] userfaultfd: selftest: Skip test if a feature isn't supported In-reply-to: <20180725141148.GD25188@rapoport-lnx> Date: Mon, 30 Jul 2018 20:54:53 -0300 MIME-Version: 1.0 Content-Type: text/plain X-TM-AS-GCONF: 00 x-cbid: 18073023-0004-0000-0000-0000146B15AB 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.01068252; UDB=6.00549142; IPR=6.00846384; MB=3.00022414; MTD=3.00000008; XFM=3.00000015; UTC=2018-07-30 23:55:23 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18073023-0005-0000-0000-00008845FB08 Message-Id: <871sbkb7oy.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=987 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1806210000 definitions=main-1807300250 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:08PM -0300, Thiago Jung Bauermann wrote: >> If userfaultfd runs on a system that doesn't support some feature it is >> trying to test, it currently ends with error code 1 which indicates >> test failure: >> >> # ./userfaultfd anon 10 10 >> nr_pages: 160, nr_pages_per_cpu: 80 >> bounces: 9, mode: rnd poll, userfaults: 7 59 >> bounces: 8, mode: poll, userfaults: 0 0 >> bounces: 7, mode: rnd racing ver, userfaults: 45 2 >> bounces: 6, mode: racing ver, userfaults: 3 1 >> bounces: 5, mode: rnd ver, userfaults: 55 32 >> bounces: 4, mode: ver, userfaults: 69 0 >> bounces: 3, mode: rnd racing, userfaults: 1 1 >> bounces: 2, mode: racing, userfaults: 65 0 >> bounces: 1, mode: rnd, userfaults: 44 1 >> bounces: 0, mode:, userfaults: 3 2 >> testing UFFDIO_ZEROPAGE: done. >> testing signal delivery: UFFDIO_API >> # echo $? >> 1 >> >> Make the testcase return KSFT_SKIP instead, which is more accurate since it >> is not a real test failure: >> >> # ./userfaultfd anon 10 10 >> nr_pages: 160, nr_pages_per_cpu: 80 >> bounces: 9, mode: rnd poll, userfaults: 3 0 >> bounces: 8, mode: poll, userfaults: 6 1 >> bounces: 7, mode: rnd racing ver, userfaults: 3 1 >> bounces: 6, mode: racing ver, userfaults: 2 1 >> bounces: 5, mode: rnd ver, userfaults: 2 1 >> bounces: 4, mode: ver, userfaults: 3 47 >> bounces: 3, mode: rnd racing, userfaults: 38 0 >> bounces: 2, mode: racing, userfaults: 4 61 >> bounces: 1, mode: rnd, userfaults: 16 6 >> bounces: 0, mode:, userfaults: 55 25 >> testing UFFDIO_ZEROPAGE: done. >> testing signal delivery: UFFDIO_API: Invalid argument >> # echo $? >> 4 >> >> While at it, also improve the error message of the ioctl(UFFDIO_API) call. > > Can you please also make the test return KSFT_SKIP if userfaultfd(2) fails > with ENOSYS? Sure. v2 will have a separate patch implementing your suggestion. -- Thiago Jung Bauermann IBM Linux Technology Center