Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp867860pxy; Wed, 5 May 2021 16:21:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyRxAi4VVnpuo8Xxfmqf4gDrvhyjXIXUdoUfH/anf3J95rju4k+qsGtWFG71Ldc+836jo6E X-Received: by 2002:a17:906:4013:: with SMTP id v19mr1160907ejj.57.1620256892314; Wed, 05 May 2021 16:21:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620256892; cv=none; d=google.com; s=arc-20160816; b=KB0/QjbvelG6ySTgoXIdQ/qZKfFGY73vFvVgBC3PaeB3xlzek31ibs8F5Zlf4LaQON 8prNUlBZ99/y7VptpTesqq7pWvoTr/uCuUK70g2z8vvzaRjIMd1kVjZnA/z4AsMA9brA NTyihwwseOf7g1f+IxfBDy6KsG/WHk6AHiFNcuO6fWubU3eo17EBWf4Ooh1BLhOPGmub elQk+x0hww0VMTekHudvATfbYf9n90PT6hxJLdxbm9oo6TSwBucfclt/s6j9UH5kKaju zZvILvtG/eucaCruYSfK+6YGKX7cVybdUYdPxQ/aKw6jXUi2zw9pNG8QMhI939aLP/f9 XTeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=UMR0l2eOxbZlG3eP2GKSR1qj/t2c7J2/JGyBVU+eog8=; b=UzgRX6/r9BHBK5PVgCh6BNuYUeK4uzMoEQ2TESioU2bxOEs6dn3jyPHNhqVLTSEQpp CCTzKTt59I0mbbRSJvvbaDWu44JspPXu5CJcEFh/9Ao//YQ5lx3NWh/yhtXkJ3m4dZCj n9D2tYvQ6msDIBpRwYpaHBVuWaer0vgfssCDt/Rck92bcOJ4QAdxhIvIf/dsgCF6YWrI JpBt6ueUbB8Rn7935sVhzPm9tz4lfHwYvjT0pK/EKXGavClKibvPPvGGa8sGTXYWvB5L Ha4JNqzaqx9y4d+FRTtnIAgPq86AupKWvzuzvhN2D9J/a/5v8JhHZ+7+JQXzeT8BUDHv 3tzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=cQHZmYHC; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y20si684585ejr.553.2021.05.05.16.21.09; Wed, 05 May 2021 16:21:32 -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=@linutronix.de header.s=2020 header.b=cQHZmYHC; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233214AbhEEWIm (ORCPT + 99 others); Wed, 5 May 2021 18:08:42 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:34752 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229691AbhEEWIl (ORCPT ); Wed, 5 May 2021 18:08:41 -0400 From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1620252463; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=UMR0l2eOxbZlG3eP2GKSR1qj/t2c7J2/JGyBVU+eog8=; b=cQHZmYHC6OYkUivvmP5eyqSEXFNg16rNN1F3SKS5vPsTkpvWp85BMTQMA1rYCrgvy6JpKF ngLJOlo35ELIF+UdKXvgw7f0Ub0fPxaXkV/jVTdp6MO63zkNZnP/SAEg+wJjUbOtoAqOsK +fEuB+qlfVvTYTODzHwYTfeEe9OP8oSGROYkXHZOQwLZNMVHECOoELLMrv8/8wErAxEL6O rWPAjg/sshQJXTCEyOhDsWx5Y83In6keIYekwWCMZWQkm4Sh4xoDJXRsgavKJCvpdcnnZ8 WjG9NC+skOS55MavRrKp4h32zRK6mL4ToC/tN84T5PuDsSGaGfhq2ZgCsA9F2g== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1620252463; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=UMR0l2eOxbZlG3eP2GKSR1qj/t2c7J2/JGyBVU+eog8=; b=1EBA3+V804rt47qlprd0RUNtZvDTp3gX9e+JSaQkFYVvO9my28iAerpC6JKqTLv3aXw/9Q WnPrz1E9oDgXBwBg== To: Jens Axboe , Stefan Metzmacher , Linus Torvalds Cc: Andy Lutomirski , linux-kernel@vger.kernel.org, io-uring@vger.kernel.org, x86@kernel.org Subject: Re: [PATCH v2] io_thread/x86: setup io_threads more like normal user space threads In-Reply-To: <878s4soncx.ffs@nanos.tec.linutronix.de> References: <20210411152705.2448053-1-metze@samba.org> <20210505110310.237537-1-metze@samba.org> <878s4soncx.ffs@nanos.tec.linutronix.de> Date: Thu, 06 May 2021 00:07:43 +0200 Message-ID: <875yzwomvk.ffs@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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