Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp895600pxy; Wed, 5 May 2021 17:16:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzQlDjAYJ5gU3uP9ADEGVSIA5gTpxC5hHA7XcWLGNMwYLBvl90RcmleLmETyyNJCpQASgiA X-Received: by 2002:a65:4281:: with SMTP id j1mr1414953pgp.348.1620260179867; Wed, 05 May 2021 17:16:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620260179; cv=none; d=google.com; s=arc-20160816; b=s+GC7GmGuW6oX9oPJJo0+yqUdzu8iIOaweV62hUdT4JT9aZgZu9ih9EMgkBaT95r7u j/7/lgCva3uDqOyYCo+kWPzlvz4p88UmyF4+fdZRk9xZLrZlj77UvfgKDa8HpBm1cBQb G19RBudGU3NNeV8bpT28R02emzXdha4cW3m9lmJ4YCFaxzKjDI3ldHgkS4oQT1cxYA04 57LsKOMU14BW3ySa8G3rXRc49M4u0EITzeqeShoUEnGMejYdIkRDLOoaxws81j3ZFOro axAOFxDdEA3FG/9/HZPqYlSFVhZ7tr/pH0En1yMXAmjl82AUnyOsolk74u4DAP5XJjOD pzUg== 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=Dlk0fYmdsA4sVPnIEMF0cY2k6ue6IGJM2lhPnSbJsv4=; b=NVbr+T46fKjOtCK7L5yu6U0puFkMVgjnds5mw/x4dcgOwDS4SUbQkpIPYfl5R2ADL9 UpQWc8sRmu/ShoOvJR7g73k7/iSORTjytnJMRzWa9yAzkcxyfm12JYEW5y8nlpQUmOK9 GUC+5bfK/VYOaZlgxPnav04hBYsyfHovHyoTW3KmsWK0RObi4MgpZsw/e09pJjN+1iUI uOIG8QVXHDewF3z5pjvTOgImuG3lNbqztL5r9GiT+5VuygF1qT3ZxCSYGDmOLtNfP+ZR 15AdCCcy3u9+ivdTeNFv4JjKW+17HFVDcOPZFAAhFtxntwX2O61Y3uggNrDo7UH0tRnf C+yw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=TcawMCA+; 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 e19si823049plj.0.2021.05.05.17.16.07; Wed, 05 May 2021 17:16:19 -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=TcawMCA+; 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 S229748AbhEEXuB (ORCPT + 99 others); Wed, 5 May 2021 19:50:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50350 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229599AbhEEXuB (ORCPT ); Wed, 5 May 2021 19:50:01 -0400 Received: from mail-pf1-x42e.google.com (mail-pf1-x42e.google.com [IPv6:2607:f8b0:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2297DC06174A for ; Wed, 5 May 2021 16:49:04 -0700 (PDT) Received: by mail-pf1-x42e.google.com with SMTP id i190so3490820pfc.12 for ; Wed, 05 May 2021 16:49:04 -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=Dlk0fYmdsA4sVPnIEMF0cY2k6ue6IGJM2lhPnSbJsv4=; b=TcawMCA+UZ4oNQP/voq1p4cIv3ZgEB1iKQt8HZdRPAjtIlpBftiLFe/vr8deNpT3Qo ZLFETzAnjg+zND0/fWjQr/eqjQCwR6JXhv0Q7UbZ1Z7NM6kXDuTgh0JrRsa78aZDVhnt NbH2ODOCseSe+8jhYA65nugS+8Pdqe9lVEkwl6jAE7A3fr61jpdEYbMfB0aXlOjup2La oal5O/X20CpjXJk7t+UWsXbhNp8ZZi+eJHWJqCWORMtqY83KTjaZrCjkhYPJnZ+SwKMW O32Mc1c7UfZbt2tmnQd8dK0CNujMONnRZUrTMpPPjEVrQ2uNWObC9BNKt4WCQIW+bWvO C2Aw== 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=Dlk0fYmdsA4sVPnIEMF0cY2k6ue6IGJM2lhPnSbJsv4=; b=YvwuFBSCbdetcNeWUqj96fhVPy/7xFnwHzzet5CBovzdUW416Q5ahQ+aH5Kfys9wDS /+TbHxgxesIWqlUqSQcydpLKfaheSxYJ11lwlZLgHHk5YRi+yb5MbdTidx0uMUJCVAsi ujygI7XeKYtiJhW9wAm/kN+6IyseWD07EUV7UUtu2H0ZBWz6L6wMXI4tjt1Y+HpcoUMd hkwa298R6uCPHs/9O4TMQC8a62govVBtnWWdexXkDSfLtBFFKYc6iECaXpG5Poe+E29I wOMcYZ2V/OT7I8qR2wJHHu8CPyuJdM0zuY4JvZpHDWzK4g2XINE6oTGB0Gnr7YPWfQOg x0NA== X-Gm-Message-State: AOAM530RFb3ENHCl+xBa7GSjJ1GQtwyFHlfK+n1X/5AIfbNJhHag5JMJ aOkvsNIi0gljzpZ2nei5FO0Xdg== X-Received: by 2002:a62:3344:0:b029:24c:735c:4546 with SMTP id z65-20020a6233440000b029024c735c4546mr1404124pfz.1.1620258543399; Wed, 05 May 2021 16:49:03 -0700 (PDT) Received: from [192.168.1.134] ([66.219.217.173]) by smtp.gmail.com with ESMTPSA id 79sm277813pfz.202.2021.05.05.16.49.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 05 May 2021 16:49:02 -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> <875yzwomvk.ffs@nanos.tec.linutronix.de> From: Jens Axboe Message-ID: Date: Wed, 5 May 2021 17:49:02 -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: <875yzwomvk.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 4:07 PM, Thomas Gleixner wrote: > On Wed, May 05 2021 at 23:57, 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? > > That said, the proper subject line would be: > > x86/process: Setup io_threads .... > > Aside of that: > > Reviewed-by: Thomas Gleixner Thanks, I've added that and modified the subject line to adhere to that style. Again, I'm fine with this going through the tip tree, just wanted to make sure it wasn't lost. So do just let me know, it's head-of-branch here and easy to chop if need be. -- Jens Axboe