From mboxrd@z Thu Jan 1 00:00:00 1970 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=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no 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 677E1C07E9C for ; Sun, 11 Jul 2021 16:35:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4E0B6610F7 for ; Sun, 11 Jul 2021 16:35:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231328AbhGKQiW (ORCPT ); Sun, 11 Jul 2021 12:38:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41948 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229817AbhGKQiW (ORCPT ); Sun, 11 Jul 2021 12:38:22 -0400 Received: from mail-ua1-x92e.google.com (mail-ua1-x92e.google.com [IPv6:2607:f8b0:4864:20::92e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 562C4C0613E5 for ; Sun, 11 Jul 2021 09:35:34 -0700 (PDT) Received: by mail-ua1-x92e.google.com with SMTP id 109so1680077uar.10 for ; Sun, 11 Jul 2021 09:35:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=posk.io; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=3f25szeD9waUmzEd9NsNG/voXya0DVJNKMcZvze03BY=; b=AxDW+nEimR3JS9jMsKxib/y9HraIdIH+Q9ai0rIiIrJ/8nCv+fpP7ILCnTboq4h38f 2d5vQQMWvcBud1MSeE+L4Ug/CuJM7nZSATyTjqR+fRiZLR1PJ4Ifhaob7UBv8gmWljwH FpoBhBe5l8ONiP7FEVPAsqZFtga2RFTRUMepWqzbmx2nHKpsX7e4Xadqh+O/sYOogkV2 Nv8Cwa3gupZHYSxQ2MtS4XUIWlt2SWICf3ax8s7tSEfyPz91I4jLpOvPV93afO/bxXIy pEhOePrjeHDzIIOa6s2DTK2nMjrgWvW1oBAiOampRS8OStvYXB0VxhH7l8wDpUKoYuDm ppKw== 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=3f25szeD9waUmzEd9NsNG/voXya0DVJNKMcZvze03BY=; b=brmtmVBTPfiXNcJWcr1TKnSSNU9mnem7Yovprb1J2ayg9vwLDJ6fjRy1VJxMtDXgqj 0dwtXF0G5fAJNDlhjcBCG65B0X99ma1blnPh28cGKqS6/d9b8Qdo9PUrwXqP8uYFzaCX frDyA9JSj7GKimhlNR+/3b/fkz74Z1aBF/mPLrs7Gk8Wlie4bOaQGd4Zwi0bDm251/dJ d81NwNjvKcVoP+34BIlAeMPax31VNAGwj8hOsG7R+sLUfawL1NAX4nPYdjfHnvYG3tG7 6ixdyka2UJHyh9nIrI1dSESAtnzyIZCNaLETdcmbfb2pTVgqyOFfbKDSVZ6sRdCJQ69M cg6g== X-Gm-Message-State: AOAM533tZ43327nOaxQrvGd+GQ9JE+rwZvRIZ/UTIE9CXX+xEDOiqxJv q5IhKbzgIipGox13OsEZqjMKk4pk67CaL2sX9urfi0AG8NM= X-Google-Smtp-Source: ABdhPJwukCIjy4XliRlv7tFpC15wEftOR6xbpev6ksmG/apE4Rd1+adHWM0Z+XSX7RjybTN30nAVYW3S/noTa+F9Wzo= X-Received: by 2002:ab0:494c:: with SMTP id a12mr46324347uad.17.1626021332827; Sun, 11 Jul 2021 09:35:32 -0700 (PDT) MIME-Version: 1.0 References: <20210708194638.128950-1-posk@google.com> <20210708194638.128950-4-posk@google.com> In-Reply-To: <20210708194638.128950-4-posk@google.com> From: Peter Oskolkov Date: Sun, 11 Jul 2021 09:35:22 -0700 Message-ID: Subject: Re: [RFC PATCH 3/3 v0.2] sched/umcg: RFC: implement UMCG syscalls To: Peter Zijlstra , Ingo Molnar , Thomas Gleixner , Linux Kernel Mailing List , linux-api@vger.kernel.org Cc: Paul Turner , Ben Segall , Peter Oskolkov , Joel Fernandes , Andrei Vagin , Jim Newsome , Jann Horn Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 8, 2021 at 12:46 PM Peter Oskolkov wrote: [...] > Pretty much everything works, with one issue: when a worker > blocks, we need to wake its server in umcg_wq_worker_sleeping > called from sched_submit_work within preempt_disable block. > As the server_tid is set by the userspace, it can point to > a running/spinning task, and so wake_server will hang waiting > for ttwu() to succeed. I do not think this is appropriate, > but I am not sure at the moment how to resolve this. Any sugestions? [...] I think I can solve this by carefully ordering state changes (both umcg state and task state) and maybe sending a signal to the wakee if not enough. I'll try this approach in v0.3.