Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp894541pxy; Wed, 5 May 2021 17:14:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwmer4AwWPczFZXH+C7UoSHit9Yw2HYE0emR1A/DQv/EbVPiSy1+orEJRswxL9QWg2Qucu2 X-Received: by 2002:a17:90a:b794:: with SMTP id m20mr1293390pjr.152.1620260060827; Wed, 05 May 2021 17:14:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620260060; cv=none; d=google.com; s=arc-20160816; b=WDEu/lcmjbywVoZ2n+nZYXeEnQN5uK3edSXXjQ5bmZVRUPHT4RGjdZZnaNIR+jPion nhkaZQzQImgIfn3FyyFzc1PWlOVmGup2DfgyEkAmj4PslY7gb2BD2x7I0xakuLjKPqd7 LAulHBkwX6R/UNcH4J2HiPCfdIv6KNhj52GpmAlSqM43hTTe7oNyXazm3EZnLSbxMhzk kPuyXCBzF2qbmiUyOuHUl5qSGd+XwbZa8FQeW3rMUwobVUcARxyGqNnJ5IIN1aH195YA x9mvcDXrMuWo/d3ZCZMl2G7PGJtjLOk4EkeaFAggvyAxwzOR/80mvREvIJ/1A9042B32 sdFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=926cAGvfUgvmtC8pdeJ7FxZmXpISXd5xiZDilkdp/Wg=; b=ZbeGT0KLXKfWfA51yw3Bl4JTr3SecxMEOTcX9y7Eb3kGOyijJ2w7Wt5nCmSs9Pet4B ubTjxkQqsCqxV4jn4MYWbP8Iwo5wdStCh+emDt8kb/yQAfftI6hVJ9K6kLB7ZT7cXnDB PaBM496HsNC/EdAKtRrTgHcB3/brymtnNGr50efQWEGHdVO3+x7JkjiTaGnfo8blt5fw rTS8/VzGFcvnL5glwY6z6x8SEwpsorXBznnwQt3MrAAnmYzGbMRuSLbLhl5Q7lizIl88 3ND4HzpQig3eprJLeHjKKBmpvkRsudW7hQN+wbsPJxnP1CL7ihFpzwZjxvf7WSroeW0m TSBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=rIHZValS; 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 ay10si698521plb.402.2021.05.05.17.14.07; Wed, 05 May 2021 17:14:20 -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=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=rIHZValS; 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 S229872AbhEEXgT (ORCPT + 99 others); Wed, 5 May 2021 19:36:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47416 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229579AbhEEXgS (ORCPT ); Wed, 5 May 2021 19:36:18 -0400 Received: from mail-pf1-x436.google.com (mail-pf1-x436.google.com [IPv6:2607:f8b0:4864:20::436]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A6B24C061574 for ; Wed, 5 May 2021 16:35:21 -0700 (PDT) Received: by mail-pf1-x436.google.com with SMTP id h127so3508579pfe.9 for ; Wed, 05 May 2021 16:35:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=926cAGvfUgvmtC8pdeJ7FxZmXpISXd5xiZDilkdp/Wg=; b=rIHZValSBd+t1BgZ2OSP/xJZ10TMnVGal1r+/yi5a609d7m2DmHcNITOwbOb0Wb5zd vfrn238jpQq5UgnFr4AVlBrHcX2ijgxjKbewbzz0xUI5hEtkvwp1DaPWkYaJ4DQw/tiF vdk37LSH0WNrDlQWW9N8lRFXVwVNASLp1ilgArxRXWAvoYCQ4710JiyURetvKXpqpNUB KjFPQqob5AHwCcwO7fUVWP132fLCBFuE7F5pmTg0ceC35VOjXKQEE6Qe2pA1x14IksHy UrM28wmnYkbJjtA/JIZOqaqxFppR4WNkDixrHQoDfnrU2v6rZw3lEjFtrJK9Z/G5+Q1I mFtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=926cAGvfUgvmtC8pdeJ7FxZmXpISXd5xiZDilkdp/Wg=; b=UayduOrK/4FRuo8Nbyje2B56regxkfDr6m+UWsIKXKNZuog8PURFyMBS75wqm0NNaj 1wmc6gCngvQvsKaGkfcxgVgl5lvlMXHtMCtgW5UnU3qUoii9Sf2LQxGPuvFOFc8H/BkM scRE9jdfJaxd5Gkz+D+1UUUWCp9iBpbJ28MwfdaRgxbCagUfDqPmgJkC3oCPTYL0sOnn XiQylSCS4CnMCnjYCufJsas2VpADPNAjzGB74CW3Js9C0iqHVqMKoIcL/XRYwcW1oLXi njfuIAqFEguAzRHaCLOB1nZaviAFGjJsGgsrNRHomTsOYKaeGKFznyd09hVocJ9f/yn+ ecdA== X-Gm-Message-State: AOAM532IsDK8HgH4clGeQK194C2hwcJQz84S3cVR1RZEhv600BZzcWIx RtbHxebbV1tKR6N3dgvm7i+g2PmEvPFv1A== X-Received: by 2002:a63:4607:: with SMTP id t7mr1240499pga.269.1620257721047; Wed, 05 May 2021 16:35:21 -0700 (PDT) Received: from [192.168.1.134] ([66.219.217.173]) by smtp.gmail.com with ESMTPSA id d18sm244862pgo.66.2021.05.05.16.35.19 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 05 May 2021 16:35:20 -0700 (PDT) Subject: Re: [PATCH v2] io_thread/x86: setup io_threads more like normal user space threads To: Thomas Gleixner , Stefan Metzmacher , Linus Torvalds Cc: Andy Lutomirski , linux-kernel@vger.kernel.org, io-uring@vger.kernel.org, x86@kernel.org References: <20210411152705.2448053-1-metze@samba.org> <20210505110310.237537-1-metze@samba.org> <878s4soncx.ffs@nanos.tec.linutronix.de> From: Jens Axboe Message-ID: <4d79811e-7b71-009d-ef31-d6af045b25fd@kernel.dk> Date: Wed, 5 May 2021 17:35:19 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <878s4soncx.ffs@nanos.tec.linutronix.de> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/5/21 3:57 PM, Thomas Gleixner wrote: > On Wed, May 05 2021 at 15:24, Jens Axboe wrote: >> On 5/5/21 5:03 AM, Stefan Metzmacher wrote: >>> As io_threads are fully set up USER threads it's clearer to >>> separate the code path from the KTHREAD logic. >>> >>> The only remaining difference to user space threads is that >>> io_threads never return to user space again. >>> Instead they loop within the given worker function. >>> >>> The fact that they never return to user space means they >>> don't have an user space thread stack. In order to >>> indicate that to tools like gdb we reset the stack and instruction >>> pointers to 0. >>> >>> This allows gdb attach to user space processes using io-uring, >>> which like means that they have io_threads, without printing worrying >>> message like this: >>> >>> warning: Selected architecture i386:x86-64 is not compatible with reported target architecture i386 >>> >>> warning: Architecture rejected target-supplied description >>> >>> The output will be something like this: >>> >>> (gdb) info threads >>> Id Target Id Frame >>> * 1 LWP 4863 "io_uring-cp-for" syscall () at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38 >>> 2 LWP 4864 "iou-mgr-4863" 0x0000000000000000 in ?? () >>> 3 LWP 4865 "iou-wrk-4863" 0x0000000000000000 in ?? () >>> (gdb) thread 3 >>> [Switching to thread 3 (LWP 4865)] >>> #0 0x0000000000000000 in ?? () >>> (gdb) bt >>> #0 0x0000000000000000 in ?? () >>> Backtrace stopped: Cannot access memory at address 0x0 >> >> I have queued this one up in the io_uring branch, also happy to drop it if >> the x86 folks want to take it instead. Let me know! > > I have no objections, but heck what's the rush here? > > Waiting a day for the x86 people to respond it not too much asked for > right? There's no rush. I just said I've queued it up, and to object if you want to take it through the tip tree. It's not going out before end of week anyway, so there's plenty of time. Then I know I won't forget... -- Jens Axboe