From patchwork Mon Apr 12 23:27:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Xu X-Patchwork-Id: 12199045 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=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,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 D7D4FC43460 for ; Mon, 12 Apr 2021 23:28:04 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 720D761220 for ; Mon, 12 Apr 2021 23:28:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 720D761220 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 1764B6B0070; Mon, 12 Apr 2021 19:28:03 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 151F16B0071; Mon, 12 Apr 2021 19:28:03 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F339F6B0072; Mon, 12 Apr 2021 19:28:02 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0229.hostedemail.com [216.40.44.229]) by kanga.kvack.org (Postfix) with ESMTP id B9A4D6B0071 for ; Mon, 12 Apr 2021 19:28:02 -0400 (EDT) Received: from smtpin18.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 75478181AC212 for ; Mon, 12 Apr 2021 23:28:02 +0000 (UTC) X-FDA: 78025305204.18.030816C Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf08.hostedemail.com (Postfix) with ESMTP id 1065D80192D5 for ; Mon, 12 Apr 2021 23:27:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1618270081; 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: in-reply-to:in-reply-to:references:references; bh=/U3KIKw69dWx5abbn2bssM3+MYf5zUQ82LjGJH8Cvss=; b=DSPvdC4orDMzFluWL6bszA8ykCcJrprureXkH4DPecCILx+xkgKoGDffNu6vXeMom0hljt rN/eaDIeVYO6e9jA1PM2zC7AlDo8ICNFiXBoN5kmokiYQnnF92dueq5lXr93juf5FdduDx +DVvryZkHh8dS1bV3ErDozQrhc1o904= Received: from mail-qv1-f71.google.com (mail-qv1-f71.google.com [209.85.219.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-430-HZukrfWcPyu1Rvpudgo1Yg-1; Mon, 12 Apr 2021 19:27:59 -0400 X-MC-Unique: HZukrfWcPyu1Rvpudgo1Yg-1 Received: by mail-qv1-f71.google.com with SMTP id u7so9019624qvf.5 for ; Mon, 12 Apr 2021 16:27:59 -0700 (PDT) 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=/U3KIKw69dWx5abbn2bssM3+MYf5zUQ82LjGJH8Cvss=; b=linwsZOVJFL7miKbwYf4yFw1XBQ2K4mo9wymLVXA4J1PVYYeDRiUc1AVWN0Y7SnTOO 3ysTF+uSpxnd0hnYNO0EF8E4a4nCOlOVsHC9iddzLr5M5TgUOk7kNCt8xNhl06F1OnFe nSDY49fnHuCNL0HtBc6ugCIKUsDFdRR/WN+uTDzhRhoLfVRx+MWTrMj8TjXXZ0ILPO1t lB6I3ov2S8TOhzii8ghJCwQ0YghVlDpTqMWLHr5qMlkwCMAFF6lalK8OW2Bp9swkPFtt jWYpRXJaSuw2xAamue5+lhXXZmZvnn3sE5TH4W9DxEXMMx3snu2YIb+tlZvVL5809J65 iEFA== X-Gm-Message-State: AOAM533E6eGOHI5onw2CVdXXLaMLX0wScsnGap3uJBaJWHKAsULtiUz8 gZ35EPoOCQI6V2Ln2c4yc7KlTJZsyLWuluBKyTdbqiM41SfKZHvIQDjU4mVTBvBCTeMOsQV6Jyw dRPdZKcHwIvj5hm4FkhBohOMydNZthHX+sSEGWQIFQg2yi0mFG43w9V1bAjG6 X-Received: by 2002:ac8:7dce:: with SMTP id c14mr27594283qte.82.1618270078833; Mon, 12 Apr 2021 16:27:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyW3JV/rb4lJVHgeg6Eo9vZH/0PbLS1F9Y9b6CV/zRlVvru2TFZeK7O+USZqeM2MwlYDhjkDQ== X-Received: by 2002:ac8:7dce:: with SMTP id c14mr27594254qte.82.1618270078541; Mon, 12 Apr 2021 16:27:58 -0700 (PDT) Received: from xz-x1.redhat.com (bras-base-toroon474qw-grc-88-174-93-75-154.dsl.bell.ca. [174.93.75.154]) by smtp.gmail.com with ESMTPSA id y29sm8958925qtm.13.2021.04.12.16.27.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Apr 2021 16:27:57 -0700 (PDT) From: Peter Xu To: linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: Andrea Arcangeli , peterx@redhat.com, Andrew Morton , Mike Rapoport , Axel Rasmussen Subject: [PATCH v2 2/5] userfaultfd/selftests: Remove the time() check on delayed uffd Date: Mon, 12 Apr 2021 19:27:50 -0400 Message-Id: <20210412232753.1012412-3-peterx@redhat.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210412232753.1012412-1-peterx@redhat.com> References: <20210412232753.1012412-1-peterx@redhat.com> 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-Stat-Signature: gdrhmb73z7qmigh1dzxaz5ezgnbty4ue X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 1065D80192D5 Received-SPF: none (redhat.com>: No applicable sender policy available) receiver=imf08; identity=mailfrom; envelope-from=""; helo=us-smtp-delivery-124.mimecast.com; client-ip=170.10.133.124 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1618270069-277192 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: There seems to have no guarantee that time() will return the same for the two calls even if there's no delay, e.g. when a fault is accidentally crossing the changing of a second. Meanwhile, this message is also not helping that much since delay could happen with a lot of reasons, e.g., schedule latency of resolving thread. It may not mean an issue with uffd. Neither do I saw this error triggered either in the past runs. Even if it triggers, it'll be drown in all the rest of test logs. Remove it. Reviewed-by: Axel Rasmussen Signed-off-by: Peter Xu --- tools/testing/selftests/vm/userfaultfd.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/tools/testing/selftests/vm/userfaultfd.c b/tools/testing/selftests/vm/userfaultfd.c index ce23db8eec26..5cae66e27171 100644 --- a/tools/testing/selftests/vm/userfaultfd.c +++ b/tools/testing/selftests/vm/userfaultfd.c @@ -395,7 +395,6 @@ static void *locking_thread(void *arg) unsigned long long count; char randstate[64]; unsigned int seed; - time_t start; if (bounces & BOUNCE_RANDOM) { seed = (unsigned int) time(NULL) - bounces; @@ -432,7 +431,6 @@ static void *locking_thread(void *arg) page_nr += 1; page_nr %= nr_pages; - start = time(NULL); if (bounces & BOUNCE_VERIFY) { count = *area_count(area_dst, page_nr); if (!count) { @@ -495,12 +493,6 @@ static void *locking_thread(void *arg) count++; *area_count(area_dst, page_nr) = count_verify[page_nr] = count; pthread_mutex_unlock(area_mutex(area_dst, page_nr)); - - if (time(NULL) - start > 1) - fprintf(stderr, - "userfault too slow %ld " - "possible false positive with overcommit\n", - time(NULL) - start); } return NULL;