From patchwork Wed Mar 10 00:45:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Xu X-Patchwork-Id: 12126789 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=-14.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT 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 B1092C433E6 for ; Wed, 10 Mar 2021 00:45:18 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 22A10650A2 for ; Wed, 10 Mar 2021 00:45:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 22A10650A2 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 5BDDB8D015A; Tue, 9 Mar 2021 19:45:17 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 56DD58D0148; Tue, 9 Mar 2021 19:45:17 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3C0638D015A; Tue, 9 Mar 2021 19:45:17 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0198.hostedemail.com [216.40.44.198]) by kanga.kvack.org (Postfix) with ESMTP id 1D8FE8D0148 for ; Tue, 9 Mar 2021 19:45:17 -0500 (EST) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id C87CC824999B for ; Wed, 10 Mar 2021 00:45:16 +0000 (UTC) X-FDA: 77902120632.13.78C481D Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by imf05.hostedemail.com (Postfix) with ESMTP id C0D4CE0011C4 for ; Wed, 10 Mar 2021 00:45:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1615337115; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8cyWZZlh/4Oiejf6D1Ll6tnqOhVgqXnmk7AI4eeRGPQ=; b=hTsWHwDD0nTxEtx2vpgH5OVWO7PUMGSEmfP786BwpdBVRXsZgTJrOvSojwNp5lrbTLGHiJ y0gKqsEa/MVzMHaJAoMJfNaTdlLzm8rqW1jTi424z8WxzVvCAiJD3n9KqQVEFjxuBR1B6r ieaDk1nxDB1km3nS0tXxkzXGMdAYd+k= Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-312-LaRiApmuNUixaB4-Nfn8fA-1; Tue, 09 Mar 2021 19:45:14 -0500 X-MC-Unique: LaRiApmuNUixaB4-Nfn8fA-1 Received: by mail-qt1-f200.google.com with SMTP id h13so11726124qti.21 for ; Tue, 09 Mar 2021 16:45:14 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=W98fuu229Cun2sqDqrjOiHtCzvQ3USdusEfS/X1ze5s=; b=oeTWhX8JYcT0R8xoVlLZhwxYxlwJR50rz0q45/leAmqSR4VN/Y7yHtqFCbxKsxvbyt Y5lzTGXq2fx6khmypnDBRtClt5LruOMXCNz5UOdmuCPpIHtrWTjnifl6OknGaZigmxMp R5mKvpbJ7D884LnCPniWWA6Mlfc0/WgePPWNm0nV6hY3/WWryyb4zhAyPuUnuBcFA4IE ymdYvT463LZJYYqPTDTEPaXvOB/10ZH8VuXYlEv8bFBoMrHJDspOTkCL4B4J+zJh+Fj8 nUbFtunbHtKupQbGo71vvojnOq+Q7fAgY17q2+rqJqcRwM+GslWlO6yxkJ4cBgohPbN/ q6YA== X-Gm-Message-State: AOAM532T/B876UnAr0cY7/b/yUbtKckPedCWulXcAW39Q913nPa3ghWf B5/O+5/ISGhRoJoqu88xS8pvFDTAC2O09Y0XXu9N0wzqzcgmM2DZli/E1JCFnR/qyO2+/bl0vPP VEQayT/R407UdWp0eN+zTPb64/HqI3C9FYhmvBcxqn7kp/Aq11YeanKNF1kGz X-Received: by 2002:a37:7985:: with SMTP id u127mr350163qkc.333.1615337113380; Tue, 09 Mar 2021 16:45:13 -0800 (PST) X-Google-Smtp-Source: ABdhPJyQmVhJtqSjUci8fVJ8o5WZ7jjvrbupE5H7DdcgunffLV1/oC/SbCBDMPCDN2MW56G7CoQWWw== X-Received: by 2002:a37:7985:: with SMTP id u127mr350131qkc.333.1615337113047; Tue, 09 Mar 2021 16:45:13 -0800 (PST) Received: from xz-x1.redhat.com (bras-vprn-toroon474qw-lp130-25-174-95-95-253.dsl.bell.ca. [174.95.95.253]) by smtp.gmail.com with ESMTPSA id b27sm11418173qkl.102.2021.03.09.16.45.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Mar 2021 16:45:12 -0800 (PST) From: Peter Xu To: linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: Axel Rasmussen , Andrew Morton , peterx@redhat.com, Andrea Arcangeli , Nadav Amit Subject: [PATCH 0/5] userfaultfd/selftests: A few cleanups Date: Tue, 9 Mar 2021 19:45:06 -0500 Message-Id: <20210310004511.51996-1-peterx@redhat.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=peterx@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: C0D4CE0011C4 X-Stat-Signature: 3xgk1mqu8q5kcgrbwjaupyos8g8psdjb Received-SPF: none (redhat.com>: No applicable sender policy available) receiver=imf05; identity=mailfrom; envelope-from=""; helo=us-smtp-delivery-124.mimecast.com; client-ip=63.128.21.124 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1615337115-397446 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: Based on v5.12-rc2-mmots-2021-03-08-21-54. I wanted to cleanup userfaultfd.c fault handling for a long time. If it's not cleaned, when the new code grows the file it'll also grow the size that needs to be cleaned... This is my attempt to cleanup the userfaultfd selftest on fault handling, to use an err() macro instead of either fprintf() or perror() then another exit() call. The huge cleanup is done in the last patch. The first 4 patches are some other standalone cleanups for the same file, so I put them together. Please review, thanks. Peter Xu (5): userfaultfd/selftests: Use user mode only userfaultfd/selftests: Remove the time() check on delayed uffd userfaultfd/selftests: Dropping VERIFY check in locking_thread userfaultfd/selftests: Only dump counts if mode enabled userfaultfd/selftests: Unify error handling tools/testing/selftests/vm/userfaultfd.c | 742 +++++++---------------- 1 file changed, 235 insertions(+), 507 deletions(-) Reviewed-by: Axel Rasmussen