Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4162730pxj; Tue, 11 May 2021 22:25:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzvnl/NY/1hSg7YG4pEjTYFUXOU3uIYQvykqxy61JDtZ7Fx/AK43mLuko68YxibgY/vD8Dx X-Received: by 2002:a05:6638:32a8:: with SMTP id f40mr30533464jav.84.1620797107566; Tue, 11 May 2021 22:25:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620797107; cv=none; d=google.com; s=arc-20160816; b=ZsrdmSx6MpP1lF6CDkHu1gVfqTT6QFaCyWHIkjgNWL30YvjP0O7w2RQ1zZ64IiGsyW trL7WvfOFToafzSq3RwtS2qDHV3hxqefhnznXRkJGL4IYPz4CF7eTDKqY+uP+2fuvSzf /3HqpJyEtMg++fcQAqxJzkM7LYIobns9DQBXqiyFftQwHtyBnO0m+5v4JwKKahENyNDD /NJyof/zbsAkW0CRuIc7fHRdlPyOvaIg9ak+o1luXgBfUOtKnilkI/VQENWm7meU725j E21xlz01XvAlmriGsFgqwSVBORDBDMNjrSdHvEc9P752lbKqwtHTHwnQfUQT4M+lSVyz mK8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:organization:references:in-reply-to:date:cc:to:from :subject:message-id; bh=2/R7vFBVfwsQdEAE4+L9nph2ATPhm5dBqxmElVHHZLE=; b=RE0povnHtQh923pvTA8kTBl9MA3ZzSUatss3zlUVnMWawbbSqfWDbe32mWqpgLlTXU 1+55+5r7LhE2jPZwdkQCbPWGgISXnVIGIh/EwfihTUOJA/cXRqrF8vLRJFH/sJ1DsHqG hiFqwOjpJ9GwA16yU7SQd57UE3HEX76vck6mxIcFznjq3G/bNZ1yPOcOQt4E5swQhv/O lWg9qJDNWz/ZZBK1PG2/SXfsEahqVSWFNweBn6V9kQaJmn3xlWWfJDMaZIiqQYscs54Q Sm4j+S5E3z1JbLqvELaK0V5d1MboxbY1mhPPIpMUomGzvNrr0hWVhXNrPMc8s0pRszgK ncXw== ARC-Authentication-Results: i=1; mx.google.com; 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 7si23216238ilz.34.2021.05.11.22.24.54; Tue, 11 May 2021 22:25:07 -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; 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 S229850AbhELFZ3 (ORCPT + 99 others); Wed, 12 May 2021 01:25:29 -0400 Received: from cloud48395.mywhc.ca ([173.209.37.211]:53856 "EHLO cloud48395.mywhc.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229627AbhELFZ3 (ORCPT ); Wed, 12 May 2021 01:25:29 -0400 X-Greylist: delayed 3587 seconds by postgrey-1.27 at vger.kernel.org; Wed, 12 May 2021 01:25:29 EDT Received: from modemcable064.203-130-66.mc.videotron.ca ([66.130.203.64]:53822 helo=[192.168.1.177]) by cloud48395.mywhc.ca with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1lggQD-00008a-LO; Wed, 12 May 2021 00:24:33 -0400 Message-ID: <17471c9fec18765449ef3a5a4cddc23561b97f52.camel@trillion01.com> Subject: Re: [PATCH] io_thread/x86: don't reset 'cs', 'ss', 'ds' and 'es' registers for io_threads From: Olivier Langlois To: Jens Axboe , Linus Torvalds , Stefan Metzmacher Cc: Thomas Gleixner , Andy Lutomirski , Linux Kernel Mailing List , io-uring , the arch/x86 maintainers Date: Wed, 12 May 2021 00:24:32 -0400 In-Reply-To: <59ea3b5a-d7b3-b62e-cc83-1f32a83c4ac2@kernel.dk> References: <8735v3ex3h.ffs@nanos.tec.linutronix.de> <3C41339D-29A2-4AB1-958F-19DB0A92D8D7@amacapital.net> <8735v3jujv.ffs@nanos.tec.linutronix.de> <12710fda-1732-ee55-9ac1-0df9882aa71b@samba.org> <59ea3b5a-d7b3-b62e-cc83-1f32a83c4ac2@kernel.dk> Organization: Trillion01 Inc Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.40.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - cloud48395.mywhc.ca X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - trillion01.com X-Get-Message-Sender-Via: cloud48395.mywhc.ca: authenticated_id: olivier@trillion01.com X-Authenticated-Sender: cloud48395.mywhc.ca: olivier@trillion01.com X-Source: X-Source-Args: X-Source-Dir: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2021-05-03 at 20:50 -0600, Jens Axboe wrote: > > I tested the below, which is the two combined, with a case that > deliberately has two types of io threads - one for SQPOLL submission, > and one that was created due to async work being needed. gdb attaches > just fine to the creator, with a slight complaint: > > Attaching to process 370 > [New LWP 371] > [New LWP 372] > Error while reading shared library symbols for > /usr/lib/libpthread.so.0: > Cannot find user-level thread for LWP 372: generic error > 0x00007f1a74675125 in clock_nanosleep@GLIBC_2.2.5 () from > /usr/lib/libc.so.6 > (gdb) info threads > ? Id?? Target Id???????????? Frame > * 1??? LWP 370 "io_uring"??? 0x00007f1a74675125 in > clock_nanosleep@GLIBC_2.2.5 () > ?? from /usr/lib/libc.so.6 > ? 2??? LWP 371 "iou-sqp-370" 0x00007f1a746a7a9d in syscall () from > /usr/lib/libc.so.6 > ? 3??? LWP 372 "io_uring"??? 0x00007f1a74675125 in > clock_nanosleep@GLIBC_2.2.5 () > ?? from /usr/lib/libc.so.6 > > (gdb) thread 2 > [Switching to thread 2 (LWP 371)] > #0? 0x00007f1a746a7a9d in syscall () from /usr/lib/libc.so.6 > (gdb) bt > #0? 0x00007f1a746a7a9d in syscall () from /usr/lib/libc.so.6 > Backtrace stopped: Cannot access memory at address 0x0 > > (gdb) thread 1 > [Switching to thread 1 (LWP 370)] > #0? 0x00007f1a74675125 in clock_nanosleep@GLIBC_2.2.5 () from > /usr/lib/libc.so.6 > (gdb) bt > #0? 0x00007f1a74675125 in clock_nanosleep@GLIBC_2.2.5 () from > /usr/lib/libc.so.6 > #1? 0x00007f1a7467a357 in nanosleep () from /usr/lib/libc.so.6 > #2? 0x00007f1a7467a28e in sleep () from /usr/lib/libc.so.6 > #3? 0x000055bd41e929ba in main (argc=, argv= out>) > ??? at t/io_uring.c:658 > > which looks very reasonable to me - no backtraces for the io threads, > and > no arch complaints. > I have reported an issue that I have with a user process using io_uring where when it core dumps, the dump fails to be generated. https://github.com/axboe/liburing/issues/346 Pavel did comment to my report and he did point out this thread as possibly a related issue. I'm far from being 100% convinced that Stefan patch can help but I am going to give it a try and report back here if it does help. Greetings, Olivier