Message ID | 20180930074259.18229-4-peterx@redhat.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E587515A7 for <patchwork-linux-mm@patchwork.kernel.org>; Sun, 30 Sep 2018 07:43:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D94AF295D2 for <patchwork-linux-mm@patchwork.kernel.org>; Sun, 30 Sep 2018 07:43:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CD993295DD; Sun, 30 Sep 2018 07:43:24 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6E586295D2 for <patchwork-linux-mm@patchwork.kernel.org>; Sun, 30 Sep 2018 07:43:24 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 567728E0005; Sun, 30 Sep 2018 03:43:23 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 5147D8E0001; Sun, 30 Sep 2018 03:43:23 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 404C58E0005; Sun, 30 Sep 2018 03:43:23 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-qt1-f198.google.com (mail-qt1-f198.google.com [209.85.160.198]) by kanga.kvack.org (Postfix) with ESMTP id 153BC8E0001 for <linux-mm@kvack.org>; Sun, 30 Sep 2018 03:43:23 -0400 (EDT) Received: by mail-qt1-f198.google.com with SMTP id d1-v6so10426896qth.21 for <linux-mm@kvack.org>; Sun, 30 Sep 2018 00:43:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:from:to:cc :subject:date:message-id:in-reply-to:references; bh=cbgn7B/FkjDMiVL7cNiqyvSHGP4pWU7H+r/K6/oK8y4=; b=fvp4bmYpnc+TbSGt/wNYR6Hgy5emcl9LEKf7O2K6lJETxaAOQuRM2azTvDNc17HESv Q+pgswMkfPt3YWF6X4CtHwuBLBjajao5EdpTRALWSdIFitNQi+Q/Gl2/oYJG/y1m2gz7 4xmNd9qzfQF2+5Nm0zutEJnBvtqXW4Q0fGwMXWRW/k6qKr6A/fu41WzCcJ+deaswyPe9 agqdPUKuHvY8g/CMWcNe4rgajkbmCWDfaKjPc0FEQEAjfZ1m2f9XMotBXbDk7BSrJ52f HV+UlAXB5IxGx3zGB41eRnLEIlR3SMz+mLHNQDtjG7G5FkH66H5rlmwCxxE5ToHAJg2z 8XRA== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of peterx@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=peterx@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com X-Gm-Message-State: ABuFfoiGuRvUUszKMV3k2IxMAdljV5IR823oS1IYgd1AGSNSu0DNbFiJ dju4FOyVzCHOpUyJ1HiQ52YfMHlpDmEQtAoJJZ7LQsLT/4Ku0ykk0WTAoZbv9lTsU07q3JiAFsX NGE9Wy28jDqwgkiGs9rLFfSnKx1rzi/Ii1hzuMhlWKjR9N513DZeoKmP4lScHsX/2Jg== X-Received: by 2002:ac8:1c1a:: with SMTP id a26-v6mr4575217qtk.16.1538293402872; Sun, 30 Sep 2018 00:43:22 -0700 (PDT) X-Google-Smtp-Source: ACcGV632CI0JwN49/wivt4rC1iBDQK+5e/Qpp+BRyOfEuRZKmqHDfgEE8d9LA51TZYgnkc/S7+eM X-Received: by 2002:ac8:1c1a:: with SMTP id a26-v6mr4575208qtk.16.1538293402404; Sun, 30 Sep 2018 00:43:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538293402; cv=none; d=google.com; s=arc-20160816; b=n4+YfAPgTq1mcd/myf4LfLZILEaATwP4dg1FJgsxNy6x2JqPr+pLHI0M29J4CrKpfO 2g6shrh3B0dp9ZxX1QNd4kkDW43NdI+gIm4nGMETWhLR2FQcQN2Tw58wv9gXciCmNx0i EcHh/Pew/oKNH2A3LrZ8nMP8PB5J2vuMmWCIHkrxZy1gl3W3+YBWdCcyLp42aK4GKSnv +jzbb5K59Q06P1yzKo3kaOMSYcSs8hAHXgyh1Wr3+CEtCkmgmUDjSGzTjjch2DbncGBd LRZqgE7hmof7mGTETxut0LGjRczlYzl9VLCisqBkqgTQOrUDehb/W7NVqXUqtt2anfYu 5lAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from; bh=cbgn7B/FkjDMiVL7cNiqyvSHGP4pWU7H+r/K6/oK8y4=; b=jcIDZ35Mvse5DGFCHXzAntbeyC+8Tfbh7CVYDhpiKSvz+bU4CpcJd3xWfnHZ+QtZ35 yHrOF/3mGH3jp12nmg57bxd+xa99NAIsSPFiovtwLCCH4uT5SXll8paUA/7AxMvgEIG4 q/a1Uu3f7mBgqlAP+h9Ab5ZJcvvjkXE7PANdGhy/M3pNgimxjHB8ZUApVs3Kn7TzjNTP PSthdzS/aR6yaauDtRKTH6Agmf0I0TMbrHg0Yk+oJa80go4kDkM4A7VADPjKhjdWh6/c AoHNA2QM9hfBKRZNphy0Ixt7ypRdVdZLZp7Z+jmJzK5nnY01CHRib5+DSTtaTiRHJxLe QKUg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of peterx@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=peterx@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from mx1.redhat.com (mx1.redhat.com. [209.132.183.28]) by mx.google.com with ESMTPS id t41-v6si7089274qth.214.2018.09.30.00.43.22 for <linux-mm@kvack.org> (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 30 Sep 2018 00:43:22 -0700 (PDT) Received-SPF: pass (google.com: domain of peterx@redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; Authentication-Results: mx.google.com; spf=pass (google.com: domain of peterx@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=peterx@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8D75FA70A; Sun, 30 Sep 2018 07:43:21 +0000 (UTC) Received: from xz-x1.nay.redhat.com (dhcp-14-128.nay.redhat.com [10.66.14.128]) by smtp.corp.redhat.com (Postfix) with ESMTP id 470DD60164; Sun, 30 Sep 2018 07:43:17 +0000 (UTC) From: Peter Xu <peterx@redhat.com> To: linux-kernel@vger.kernel.org Cc: Shuah Khan <shuah@kernel.org>, Mike Kravetz <mike.kravetz@oracle.com>, Mike Rapoport <rppt@linux.vnet.ibm.com>, Jerome Glisse <jglisse@redhat.com>, peterx@redhat.com, linux-mm@kvack.org, Zi Yan <zi.yan@cs.rutgers.edu>, "Kirill A . Shutemov" <kirill@shutemov.name>, linux-kselftest@vger.kernel.org, Shaohua Li <shli@fb.com>, Andrea Arcangeli <aarcange@redhat.com>, "Dr . David Alan Gilbert" <dgilbert@redhat.com>, Andrew Morton <akpm@linux-foundation.org> Subject: [PATCH v2 3/3] userfaultfd: selftest: recycle lock threads first Date: Sun, 30 Sep 2018 15:42:59 +0800 Message-Id: <20180930074259.18229-4-peterx@redhat.com> In-Reply-To: <20180930074259.18229-1-peterx@redhat.com> References: <20180930074259.18229-1-peterx@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Sun, 30 Sep 2018 07:43:21 +0000 (UTC) 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: <linux-mm.kvack.org> X-Virus-Scanned: ClamAV using ClamSMTP |
Series |
userfaultfd: selftests: cleanups and trivial fixes
|
expand
|
diff --git a/tools/testing/selftests/vm/userfaultfd.c b/tools/testing/selftests/vm/userfaultfd.c index 7a8c6937cc67..5d1db824f73a 100644 --- a/tools/testing/selftests/vm/userfaultfd.c +++ b/tools/testing/selftests/vm/userfaultfd.c @@ -626,6 +626,12 @@ static int stress(unsigned long *userfaults) if (uffd_test_ops->release_pages(area_src)) return 1; + + finished = 1; + for (cpu = 0; cpu < nr_cpus; cpu++) + if (pthread_join(locking_threads[cpu], NULL)) + return 1; + for (cpu = 0; cpu < nr_cpus; cpu++) { char c; if (bounces & BOUNCE_POLL) { @@ -643,11 +649,6 @@ static int stress(unsigned long *userfaults) } } - finished = 1; - for (cpu = 0; cpu < nr_cpus; cpu++) - if (pthread_join(locking_threads[cpu], NULL)) - return 1; - return 0; }