Received: by 2002:ab2:6c55:0:b0:1fd:c486:4f03 with SMTP id v21csp457692lqp; Wed, 12 Jun 2024 06:53:39 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUwCPpWRsTk+M9pETqey9SFsSLmWUZks9CdUM905DKl9jsdpP9SxIMrabTO/CYds5UhLSOjW9gow3Jaw+4tFwFQo5KAaf2Dr0JkZYGwdw== X-Google-Smtp-Source: AGHT+IGPZ2p0JY1uhZ4m2s0qGre7U4RFc+gHVOU8toWskwTgks/91Qh6cKoDRzX8GMq2CMYsZlpb X-Received: by 2002:a17:902:e5ca:b0:1f7:1d71:25aa with SMTP id d9443c01a7336-1f83ae5eeacmr35110865ad.6.1718200418768; Wed, 12 Jun 2024 06:53:38 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718200418; cv=pass; d=google.com; s=arc-20160816; b=vJAigNljDjVzDPdvvJgqdnFAl4R1QVHFWTAwruCsBql3pY4+pZVmf3AeG9AJObw+yE 1wq/J8VlQzoi4zIvxdGA0TRZ3mWxsb6XJaHLilHhYlDmm3dVGZ++MEGAstIeoFA3eLzu gWjazCACYsvhU8jNH1C8J3Ex2R/DHBnV0DevgtHpKmd8++C5bXJ63k0sPDHJ6FMTpsXD wnazDZuXlpGtKEF/Vb+FZh+qLZPlmA8Tvb77l5rX6oaxeiiebEqD5ya4OXh+WlmuF+S8 zAKNiupwuV0uqjO/A4jkw8ahzNvpQ+h9ZglcqtcZyGrXD8HyDDf5wjUYHq0z0xoCHrd3 IXQg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:content-language:references :to:from:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=2bc6XZQC+pu8/aGiFTyN2/kmoeF3F+5LCRlKYM1dDFw=; fh=2GjrPsiWC1ZPGCn2Yk8MrREMFrxHsXRoyDvGCtYWlnA=; b=HGTRvXjUXWy0a/roT30/Fyshn90T/+G2jFy5mpzdBw7QUGIxJJBeAO3RHo6J7K+Z8M H8pY2r9NLQcLf8TbvLGBzTtCFzn7VHRNakQSn6boS9Z1QuNdhihtdl79m8mvdMDkhNz7 ENE7slTwuaGvQ0FBXZ0frajZI0z6+/egsTwAZI7rQlzpqwKfQlWSnIe8uEP15KsPjTzO nHoUJkTJFo1/1BCoMnk+ykUID878bfDnTeVRxbnfJJvkzzpWok44vEGP8/V6wpo6eRQm 8EmGNnQtHjxnrYB0aKf3wfNV/QmI4Wo2/oPbwYLPk8lTXM39K1acNri/qWptvJOj050t 2G+w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=GfKfh0B1; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-211599-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-211599-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id d9443c01a7336-1f6da3ab415si85040645ad.92.2024.06.12.06.53.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jun 2024 06:53:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-211599-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=GfKfh0B1; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-211599-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-211599-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id CE26EB2217C for ; Wed, 12 Jun 2024 13:52:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 918D617DE39; Wed, 12 Jun 2024 13:52:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="GfKfh0B1" Received: from mail-ej1-f46.google.com (mail-ej1-f46.google.com [209.85.218.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1DCF317DE34; Wed, 12 Jun 2024 13:52:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718200349; cv=none; b=GCdf6RXvQKn4dRzVGRIVUGzueL/3BK4tJMrRtnGM4KjsYRj+tr7jJ9+584+m9J4926B/0dRlCZjCg35x6deIObpq1d7gUnMxZKwc+oZeNoiFr/GxkxJJYAupdTzJPpVZsEkPDIHivivEAmC7hFuoh85m6ZdGv/0AyYvcxN147qw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718200349; c=relaxed/simple; bh=UqMzqbXKOkO76fD/Q0Ho9aIFw47zcnwUeK/a7nuXcys=; h=Message-ID:Date:MIME-Version:Subject:From:To:References: In-Reply-To:Content-Type; b=bBlXBX1OblPMh7FMjunwaLXt1KCNdUIEPNSkxyD6StZlookqS8pirPVXOlJHZQXPb9DS6nVTktxoevKL9hlVm+lll5XD37ORnJOUj7MjjjS184ru4nJS1sxHoRKm7HqsYO7WnhZFRjqGHjcVcYTGMsjcNWRgZWPg+6yDkzFNXLY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=GfKfh0B1; arc=none smtp.client-ip=209.85.218.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ej1-f46.google.com with SMTP id a640c23a62f3a-a6e349c0f2bso685678566b.2; Wed, 12 Jun 2024 06:52:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718200346; x=1718805146; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:content-language:references :to:from:subject:user-agent:mime-version:date:message-id:from:to:cc :subject:date:message-id:reply-to; bh=2bc6XZQC+pu8/aGiFTyN2/kmoeF3F+5LCRlKYM1dDFw=; b=GfKfh0B1RI9idRtXh/NWHf5qqx43k14hmVSO92Ai928hkYrXN7Qm5Rg/kEJZU2kCe+ 4paKLy5A4dDPG1nZqMhdy+U5560l1ibGFNKa9OJZuab2vmpWWVj7TChk0nyXItSb+oQR HSg415xweozuWB27+GMHMMhq1BMk0VTPtg2WvgqrsMPmqC8ADs2XzZphoTxtlNQ/vR2I oBiZVi54hq1txaKIAZBAaaovgL2gi8bILUuBVFu/D8L0viT/ijP3RmQApyCHiHyySGsN bsGjl8UeMp7FuLPRXigAetnRWIdPH72hw9oZhTawBKnp9T2fkixLoMv06t92a3X9umMo 0LAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718200346; x=1718805146; h=content-transfer-encoding:in-reply-to:content-language:references :to:from:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=2bc6XZQC+pu8/aGiFTyN2/kmoeF3F+5LCRlKYM1dDFw=; b=HeZBKoCmNFYQZWjeChXvM7WhbO+QL9QSlnpYb+ENvV1B8uoHqPRjJqi2D9GeF5xwf4 PzC22zG9tcIL7xXNMOz7IIF61T4rh2yLiWyliotUd36xp7scv8QgZYWhzGePIswLp+Pu b3LnNeDKBfhU84561/tT2sWOasiDynEXN+hTUW3i6t5QcJjb01ydXTpNy49kZ8nlKqYy 2W2aZuX0GJxWSCvZXBHX8uvgz2WaJFqGuj4GMc721aDAoHRyH6eJvNsNjkapB9jYEecS XGTnFpXwd1AQTxGT3vQ1D8DsxBXm+jgcdbT4ABA2psZ6XP7YxaWtcdyY7CrGM3hG60R8 ppCw== X-Forwarded-Encrypted: i=1; AJvYcCVFS6c0LFOT73p+asa2F7BIY6CT/P3efBlEXmcA2L9sc5YQtvCLkMm7jIBbtiMWGGt6Ca+Q7f/pJwNGOncKHBk/1nV/SMPdjwaw6epzvefifR9bkzzNt3X5nKMwKLYCM9VZOsrV+Os= X-Gm-Message-State: AOJu0YxGXVQ388FMKTUYjg2KrUKS98WHdA4311WNohq/2EWEU0BgEWZl D0OaWeDnuP26Ld0YUQxxC5WAytXEgT0zf8Bssd7P+AHAVLtHYMHX X-Received: by 2002:a17:907:2d21:b0:a6f:147f:7d06 with SMTP id a640c23a62f3a-a6f480288d6mr123721566b.77.1718200346217; Wed, 12 Jun 2024 06:52:26 -0700 (PDT) Received: from [192.168.42.148] ([163.114.131.193]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a6f0b5371d2sm574318766b.39.2024.06.12.06.52.25 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 12 Jun 2024 06:52:25 -0700 (PDT) Message-ID: <8431d920-ab84-447d-84fc-eb7904b1c733@gmail.com> Date: Wed, 12 Jun 2024 14:52:34 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [io-uring] WARNING in io_fill_cqe_req_aux From: Pavel Begunkov To: chase xd , Jens Axboe , io-uring@vger.kernel.org, linux-kernel@vger.kernel.org References: <4fd9cd27-487d-4a23-b17a-aa9dcb09075f@gmail.com> <6213cf3d-b114-4c27-b9c5-6339b9f363aa@gmail.com> Content-Language: en-US In-Reply-To: <6213cf3d-b114-4c27-b9c5-6339b9f363aa@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 6/12/24 13:35, Pavel Begunkov wrote: > On 6/12/24 08:10, chase xd wrote: >> Sorry now I'm also a bit confused by the branch choosing. I checked >> out branch "for-6.9/io_uring" and started testing on that branch. I >> assume that was the latest version of io_uring at that time, even now >> I check out that branch and the bug still exists. How should I know >> whether the branch will be merged, and which branch do you think I >> should test on? Thanks. > > # git show a69d20885494:io_uring/io_uring.c | grep -A 13 io_fill_cqe_req_aux > bool io_fill_cqe_req_aux(struct io_kiocb *req, bool defer, s32 res, u32 cflags) > { >         struct io_ring_ctx *ctx = req->ctx; >         u64 user_data = req->cqe.user_data; > >         if (!defer) >                 return __io_post_aux_cqe(ctx, user_data, res, cflags, false); > >         lockdep_assert_held(&ctx->uring_lock); >         io_lockdep_assert_cq_locked(ctx); > >         ctx->submit_state.flush_cqes = true; >         return io_fill_cqe_aux(ctx, user_data, res, cflags); > } > > That's the buggy version from the hash you're testing, IIRC it > was in the tree for longer than necessary, presumably which is > why you found it, but it was never sent to Linus. Below is > current state of for-6.9 and what it was replaced with > respectively. Let me separately check for-6.9/io_uring if you're > concerned about it. In other words, it happens that bugs appear in the branches but get rooted out before it gets anywhere. The main confusion is that the version you're looking at was fixed up back somewhere in March. That's fine, I'd just recommend fetch the repo and update your base. I can't hit the problem with for-6.9/io_uring, which make sense because it's lacking the patch I'd blame it to. I'm confused how you see it there. > # git show for-6.9/io_uring:io_uring/io_uring.c | grep -A 30 io_fill_cqe_req_aux > bool io_fill_cqe_req_aux(struct io_kiocb *req, bool defer, s32 res, u32 cflags) > { >         struct io_ring_ctx *ctx = req->ctx; >         u64 user_data = req->cqe.user_data; >         struct io_uring_cqe *cqe; > >         lockdep_assert(!io_wq_current_is_worker()); > >         if (!defer) >                 return __io_post_aux_cqe(ctx, user_data, res, cflags, false); > >         lockdep_assert_held(&ctx->uring_lock); > >         if (ctx->submit_state.cqes_count == ARRAY_SIZE(ctx->completion_cqes)) { > ... > > # git show origin/for-6.10/io_uring:io_uring/io_uring.c | grep -A 13 io_req_post_cqe > bool io_req_post_cqe(struct io_kiocb *req, s32 res, u32 cflags) > { >         struct io_ring_ctx *ctx = req->ctx; >         bool posted; > >         lockdep_assert(!io_wq_current_is_worker()); >         lockdep_assert_held(&ctx->uring_lock); > >         __io_cq_lock(ctx); >         posted = io_fill_cqe_aux(ctx, req->cqe.user_data, res, cflags); >         ctx->submit_state.cq_flush = true; >         __io_cq_unlock_post(ctx); >         return posted; > } > -- Pavel Begunkov