Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2401253yba; Thu, 25 Apr 2019 16:06:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqxiHG5DcjRzruWU22AOKtISzr6mrDf+FEV7vaRLHOyne7vTuWqK4yVznWFFyrB2B12wPbG3 X-Received: by 2002:a63:c746:: with SMTP id v6mr40151481pgg.401.1556233573733; Thu, 25 Apr 2019 16:06:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556233573; cv=none; d=google.com; s=arc-20160816; b=R3X08EQDi+auA1v9B5XKcKlfEBD6P0NdrerRmrYU+G8GtYyuC/nb91yIiRnNBhb14k ZZOFDw7AYtQoziARaRpvVZRr+VC5gSbBqVdLyfF5L6tDJE9y3b63LuA2wkZJKvlQS8bc RDKByvQYeol7geeowY5t07aRKho65m35mCuK3XgBC39ra8Sg+HloUERDBV868WDsNom4 IwdRo7e+bI1DFMbFURuD7FkY3s56uOGkn1j5EUaTxSulSD/X/BWbXZAwcGDcUl0lGB2D fyjVGyZqWRLgllEcG+0TB9oX4oL2hNP/t4u6vhN5mOH6VEM0AOQ+v3+vQtbuCqMx/PzH BU2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=Ak1U3Odv0aZPvdj1RHbAifHko/b4UA9d9R+tGHvT3SU=; b=tmFYclwiwtWG+QXjzhO133x/fq12uXEbTGSNcd6K8WTCQy3H2+P1V4U99yvsUaeJg8 AsCuo4YJhF+N0kbwclxRkYMiogO4VMXDMoVO/BftBeyEer+OIZrV23g4za0VbM7WuD8I TPYBz+58otDsaJ54p5GnScYZ8KhUV8ZLcpyKR+hpV//RUKsfXWuCenUp33EmXO4xP7fb 5YbKF6jQ5mk/qg3QmHW76AFgA4L7SFWGp9sTq2EZWEB9W4VlVSmIDw/pJBun4l+vigMZ A8TKVEzlgHVqZJ/kkX32xIj5XHU0T3mvl4N//JzVedXILZOFS2mczQ9qLDc6DGF/0SDq t++g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="NDxI/Dco"; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 31si11604028plj.417.2019.04.25.16.05.57; Thu, 25 Apr 2019 16:06:13 -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; dkim=pass header.i=@google.com header.s=20161025 header.b="NDxI/Dco"; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731430AbfDYWIB (ORCPT + 99 others); Thu, 25 Apr 2019 18:08:01 -0400 Received: from mail-vs1-f68.google.com ([209.85.217.68]:34567 "EHLO mail-vs1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730866AbfDYWIB (ORCPT ); Thu, 25 Apr 2019 18:08:01 -0400 Received: by mail-vs1-f68.google.com with SMTP id n17so824378vsr.1 for ; Thu, 25 Apr 2019 15:08:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Ak1U3Odv0aZPvdj1RHbAifHko/b4UA9d9R+tGHvT3SU=; b=NDxI/Dcoa+z67Sw2V2npnR0n2nLQk/jE/p+glUFhp+cEzHige6Tbre3ctX/y6SQsig uug5O/szCEt1CHnTkfEAKjSDYGjryb1jVsODR+WNT9t1Njq+1+d+IbaAfSFAXWbJhIW7 BDCBKeeOC735mWGztzLTOm/fI6a0oASUIKxY2/TWciNDCtilbeyY9tCHkDYjHji0a3AT dcvi/Wn4JxpbmHjKlrjtbaY0JJQrnwVhANH5YDQnjvHZh6axscx2KPMqJc/qubAkke6k wmDmIB6QhJmgpMEmroR+dTcuH0nZjZY5TD85mI+ckK+jCzhUbjK7zB1df4fsXioARDSP riXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Ak1U3Odv0aZPvdj1RHbAifHko/b4UA9d9R+tGHvT3SU=; b=QPg6zF0nv5NKJDvnZqt53y+CXtnM42EhS4b2cBln6+oQujYlFR/kWEUgsV69zhFsjb yID0n7PoL/PxjmCjD2cGkU5xkK7VfH9gHcwuWIKD6Fo32fVgGSem4CpFAu82ntG2Em2n t2IwrYxeyrs8lt65kP0Jsf+N7J08BYtWsgTbFlJeicAh2DBZ23GVJpPihumQcRqwjbuD CFr9Qr0R4b2OgqH0Q66ZoNYHwPizR7+JJSS6af6m2rqQdQ0rKLSEbONhfhAkRvNQV7LW ++iLNTIxjOAoIPU1lVZyvRh84vxXH2xdxM+nGQzIc29BWENUa4VUK0h7x7rI/rW9YX0k HpGg== X-Gm-Message-State: APjAAAVbtPfBwXtwPlqImO50rzq8mQtacnCQxvTui1TQQS6yOfYfYgZM 7IwgwKqwVN7yqaOeer4sXufNoV8aBw/DS+9+OUHVsA== X-Received: by 2002:a67:ea0a:: with SMTP id g10mr21694902vso.77.1556230079881; Thu, 25 Apr 2019 15:07:59 -0700 (PDT) MIME-Version: 1.0 References: <20190425190010.46489-1-joel@joelfernandes.org> <20190425190010.46489-2-joel@joelfernandes.org> <20190425212917.yotnir4uqgpnh764@brauner.io> In-Reply-To: <20190425212917.yotnir4uqgpnh764@brauner.io> From: Daniel Colascione Date: Thu, 25 Apr 2019 15:07:48 -0700 Message-ID: Subject: Re: [PATCH v1 2/2] Add selftests for pidfd polling To: Christian Brauner Cc: "Joel Fernandes (Google)" , linux-kernel , Andrew Morton , Arnd Bergmann , "Eric W. Biederman" , Greg Kroah-Hartman , Ingo Molnar , Jann Horn , Jann Horn , Jonathan Kowalski , Android Kernel Team , "open list:KERNEL SELFTEST FRAMEWORK" , Andy Lutomirski , Michal Hocko , "Peter Zijlstra (Intel)" , Steven Rostedt , Serge Hallyn , Shuah Khan , Sandeep Patil , Stephen Rothwell , Suren Baghdasaryan , Thomas Gleixner , Tim Murray , Linus Torvalds , Tycho Andersen Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 25, 2019 at 2:29 PM Christian Brauner wrote: > This timing-based testing seems kinda odd to be honest. Can't we do > something better than this? Agreed. Timing-based tests have a substantial risk of becoming flaky. We ought to be able to make these tests fully deterministic and not subject to breakage from odd scheduling outcomes. We don't have sleepable events for everything, granted, but sleep-waiting on a condition with exponential backoff is fine in test code. In general, if you start with a robust test, you can insert a sleep(100) anywhere and not break the logic. Violating this rule always causes pain sooner or later. Other thoughts: IMHO, using poll(2) instead of epoll would simplify the test code, and I think we can get away with calling pthread_exit(3) instead of SYS_exit.