Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp2328174pxv; Sun, 11 Jul 2021 09:36:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxWGBS7E+EqkT6m+72aqAMDywK8qpR8Tt5t8jd2tenboh4G+AMgTREgwLMcNKK4uLikqYYj X-Received: by 2002:a05:6402:68a:: with SMTP id f10mr59728154edy.99.1626021415739; Sun, 11 Jul 2021 09:36:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626021415; cv=none; d=google.com; s=arc-20160816; b=DaW/oeVoVfSrPW85CkJoBp6tnjjrnHTt0oTsOC11iEg4O1/qhkf7G9cc/+THVjBMqz T2mY3/O0ahVWxgnCHVEcx4OLdDVH8mh2GfiZgXFr+VDsvOm3yHAeD+TPiNJHD2KPMOYs qz/BERHy6tnPDHw/HWnCc87EZqG0qCuwEM79ojLdf3P0mULSCm2asgTmJj7rvwB5kAPf S9u/2V7Gin46E0Z+1faeYCoxAh6OnmY6hpShK4gVKF1Wix/0+pxG21UeSvwL09dqO4mc hnQGvl0Je5FKy0JD2/wnvrAQ5pTu36AeySIraexoXMuKXYZ/z/TqostbO9RZb9ewtl9f DNVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=3f25szeD9waUmzEd9NsNG/voXya0DVJNKMcZvze03BY=; b=BJ5KHrDD+NQ0geFHVnnTpl+0d+8XHrzz8m9lAzTd+kV8LDag5OyKdb9NbTjmT6ZDv3 Br8hqFbV69lHFTi9nobowlY8I4N5eIICoy2TSuTuurGnwNUMEoe1/Dsdgp4rpBMtkMpA nWXGsT+TqwaIJx4BK29l/CQnacLoQo+LXVCeiyZ88TYh7Usq3i8ClBqryCEzizLfmYOm CNNoqT1MORNODW77NwjSdOR+l7l2/yU1gRwK9y2LNdNaU2noaJ5uHVXHDlwfIWKxdeEq 1EendBASwO9kSG74TNjabwIXWnRI5XhZad9Sntht22mQPIPuTsvccQvqrHW1wWM2VZAj USOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@posk.io header.s=google header.b=AxDW+nEi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j23si17079878eje.719.2021.07.11.09.36.32; Sun, 11 Jul 2021 09:36:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@posk.io header.s=google header.b=AxDW+nEi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230104AbhGKQiW (ORCPT + 99 others); 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-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.