From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f170.google.com (mail-pg1-f170.google.com [209.85.215.170]) (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 36FF0136A for ; Wed, 20 Nov 2024 00:08:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.170 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732061290; cv=none; b=nvgLTa5Kr7ONg9SJtWM1F1fWXNcVtaJEe8TRG02bMzDiU3FtVudIuWxXo4UshoMuFCH9AOumbWq6Erh071GY0l9hZIZ5ie2WoJDfrB8dmoiGGw/EuqNZUXQKN0hVddDEE+dLLGyhPx3Kpw4lnwkSa4UhnSfVAI4NUtcDVV6hXwk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732061290; c=relaxed/simple; bh=suFJH8ftPUElNJ/6NknMpl7ahQ53aixmzyfTtet9J4M=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Hrlzqc5FesG9JPARrnoGXVPZT2tBqWinVaV2REqK3mPCPH/aPlBufyZcdOVniPuWKOqDNQrCVwEC8df45BMup1Xm0Cs7LA3rzTiSyaqgHKpzd9KHAKpEqFm+apK2YFqNVHjZfwnxLSdRHz49RDdScLQVnuuSbBbR2L7/LpHDh28= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=roeck-us.net; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=IMIDUGva; arc=none smtp.client-ip=209.85.215.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=roeck-us.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="IMIDUGva" Received: by mail-pg1-f170.google.com with SMTP id 41be03b00d2f7-7f8095a200eso250205a12.1 for ; Tue, 19 Nov 2024 16:08:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1732061287; x=1732666087; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:sender:from:to:cc:subject:date:message-id:reply-to; bh=QEnjiLg99GHNvuXzybJn0u4p05LBLuNnZoW4ozsgyMI=; b=IMIDUGvaOmNJuhszONQjltRsaCk6ikfQak0fSp3QZTTSdXI74p+wbpdy8Ihaj89a+0 Mdf/HRC/Ht4xuOJCLO0wZWQPANaWSIUuT8/GKGTyMVj3Ka+m3YU0IXqogFHyZaEMZ1b5 0CBc2i+kFU92vMqW/O2MzuQzMW5BwZk4lXkPrLWr/uDFjTZoxCMZXFq29hE7R4NCI1xy MHne2Ov3Y19fuJKcXcCNuyQ74tuV/VEqZf9OMJPX2tLc7YiDfJ/SrbpPXccLcLwV6VU7 0ifcV3rclhzRxMbe2wq1BfaVZv3kQ0XcJeIbTMEehRW1WOrfpMnghAuSqqHymDcIhT2D sOVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732061287; x=1732666087; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:sender:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=QEnjiLg99GHNvuXzybJn0u4p05LBLuNnZoW4ozsgyMI=; b=Pu0JU1L+5ndNEbu0btvN4skt//PykqkXGaMNOHtfi3WkWF2ZLExN++BKMdvpn11Neb hL8SRL710VXoPHkgckIsfQcVPzCiessakyH+b7Yqlj1HYqwbDn9K1cpXiPogUkBW6Z4J Atx/VdRm8c6xykKKJj2HccqVVhV7y5SZg9bxLLZKQRJ23e2VOw3j0keDHDONL2oNdPME VvWrgkwBvmJIztqF5bmjf3Ds0OcDNnebqde/t29uugwMgY8JJZj5HhhZguoEPuCwZ2gA YD3o713lI1QpcRZXCMNc58aBZJhFVpDT9zM04r/Jn7wGmJxLiVzWm8/ImKAn/15BM1Bm JxuA== X-Gm-Message-State: AOJu0YxhdnQLNQsq2lFdwT0xRHm9+yK4vjrZOd7r4qBlRZaAdidJzXrg 0sxUe0Tu7VPu6BiVMd5dfok2YDjSCn7F88mIwnL1Nl/wrpkHojUO X-Google-Smtp-Source: AGHT+IFe0j0y7Gwh0LW4r8ybNGJ340/wIxk67Mv7UZNF4EhrKPKqZEV1WVgePSlD5a5Uxmw0OVlrsw== X-Received: by 2002:a17:90b:3b91:b0:2ea:4c4d:95a1 with SMTP id 98e67ed59e1d1-2eaaa80c884mr7738473a91.17.1732061287272; Tue, 19 Nov 2024 16:08:07 -0800 (PST) Received: from ?IPV6:2600:1700:e321:62f0:329c:23ff:fee3:9d7c? ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2ead0172fccsm26398a91.0.2024.11.19.16.08.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 19 Nov 2024 16:08:06 -0800 (PST) Sender: Guenter Roeck Message-ID: Date: Tue, 19 Nov 2024 16:08:04 -0800 Precedence: bulk X-Mailing-List: io-uring@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 03/14] io_uring: specify freeptr usage for SLAB_TYPESAFE_BY_RCU io_kiocb cache To: Jens Axboe , Geert Uytterhoeven Cc: io-uring@vger.kernel.org, linux-m68k References: <20241029152249.667290-1-axboe@kernel.dk> <20241029152249.667290-4-axboe@kernel.dk> <37c588d4-2c32-4aad-a19e-642961f200d7@roeck-us.net> <5a7528c4-4391-4bd9-bbdb-a0247f3c76a9@kernel.dk> <5851cd28-b369-4c09-876c-62c4a47c5982@kernel.dk> <358710e8-a826-46df-9846-5a9e0f7c6851@kernel.dk> <82b97543-ad01-4e42-b79c-12d97c1df194@kernel.dk> <4623f30c-a12e-4ba6-ad99-835764611c67@kernel.dk> <47a16a83-52c7-4779-9ed3-f16ea547b9f0@roeck-us.net> <6c3d73a5-b5ef-455f-92db-e6b96ef22fba@kernel.dk> Content-Language: en-US From: Guenter Roeck Autocrypt: addr=linux@roeck-us.net; keydata= xsFNBE6H1WcBEACu6jIcw5kZ5dGeJ7E7B2uweQR/4FGxH10/H1O1+ApmcQ9i87XdZQiB9cpN RYHA7RCEK2dh6dDccykQk3bC90xXMPg+O3R+C/SkwcnUak1UZaeK/SwQbq/t0tkMzYDRxfJ7 nyFiKxUehbNF3r9qlJgPqONwX5vJy4/GvDHdddSCxV41P/ejsZ8PykxyJs98UWhF54tGRWFl 7i1xvaDB9lN5WTLRKSO7wICuLiSz5WZHXMkyF4d+/O5ll7yz/o/JxK5vO/sduYDIlFTvBZDh gzaEtNf5tQjsjG4io8E0Yq0ViobLkS2RTNZT8ICq/Jmvl0SpbHRvYwa2DhNsK0YjHFQBB0FX IdhdUEzNefcNcYvqigJpdICoP2e4yJSyflHFO4dr0OrdnGLe1Zi/8Xo/2+M1dSSEt196rXaC kwu2KgIgmkRBb3cp2vIBBIIowU8W3qC1+w+RdMUrZxKGWJ3juwcgveJlzMpMZNyM1jobSXZ0 VHGMNJ3MwXlrEFPXaYJgibcg6brM6wGfX/LBvc/haWw4yO24lT5eitm4UBdIy9pKkKmHHh7s jfZJkB5fWKVdoCv/omy6UyH6ykLOPFugl+hVL2Prf8xrXuZe1CMS7ID9Lc8FaL1ROIN/W8Vk BIsJMaWOhks//7d92Uf3EArDlDShwR2+D+AMon8NULuLBHiEUQARAQABzTJHdWVudGVyIFJv ZWNrIChMaW51eCBhY2NvdW50KSA8bGludXhAcm9lY2stdXMubmV0PsLBgQQTAQIAKwIbAwYL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cyIGqvg9os4rNkUWmrCfLLsZDHD8FnU mDW4+i+XlNFUPUYMrIKi9joBhu18ssf5i5Q= In-Reply-To: <6c3d73a5-b5ef-455f-92db-e6b96ef22fba@kernel.dk> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 11/19/24 14:30, Jens Axboe wrote: > On 11/19/24 2:46 PM, Guenter Roeck wrote: >> On 11/19/24 11:49, Jens Axboe wrote: >>> On 11/19/24 12:44 PM, Jens Axboe wrote: >>>> On 11/19/24 12:41 PM, Geert Uytterhoeven wrote: >>>>> Hi Jens, >>>>> >>>>> On Tue, Nov 19, 2024 at 8:30?PM Jens Axboe wrote: >>>>>> On 11/19/24 12:25 PM, Geert Uytterhoeven wrote: >>>>>>> On Tue, Nov 19, 2024 at 8:10?PM Jens Axboe wrote: >>>>>>>> On 11/19/24 12:02 PM, Geert Uytterhoeven wrote: >>>>>>>>> On Tue, Nov 19, 2024 at 8:00?PM Jens Axboe wrote: >>>>>>>>>> On 11/19/24 10:49 AM, Geert Uytterhoeven wrote: >>>>>>>>>>> On Tue, Nov 19, 2024 at 5:21?PM Guenter Roeck wrote: >>>>>>>>>>>> On 11/19/24 08:02, Jens Axboe wrote: >>>>>>>>>>>>> On 11/19/24 8:36 AM, Guenter Roeck wrote: >>>>>>>>>>>>>> On Tue, Oct 29, 2024 at 09:16:32AM -0600, Jens Axboe wrote: >>>>>>>>>>>>>>> Doesn't matter right now as there's still some bytes left for it, but >>>>>>>>>>>>>>> let's prepare for the io_kiocb potentially growing and add a specific >>>>>>>>>>>>>>> freeptr offset for it. >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> Signed-off-by: Jens Axboe >>>>>>>>>>>>>> >>>>>>>>>>>>>> This patch triggers: >>>>>>>>>>>>>> >>>>>>>>>>>>>> Kernel panic - not syncing: __kmem_cache_create_args: Failed to create slab 'io_kiocb'. Error -22 >>>>>>>>>>>>>> CPU: 0 UID: 0 PID: 1 Comm: swapper Not tainted 6.12.0-mac-00971-g158f238aa69d #1 >>>>>>>>>>>>>> Stack from 00c63e5c: >>>>>>>>>>>>>> 00c63e5c 00612c1c 00612c1c 00000300 00000001 005f3ce6 004b9044 00612c1c >>>>>>>>>>>>>> 004ae21e 00000310 000000b6 005f3ce6 005f3ce6 ffffffea ffffffea 00797244 >>>>>>>>>>>>>> 00c63f20 000c6974 005ee588 004c9051 005f3ce6 ffffffea 000000a5 00c614a0 >>>>>>>>>>>>>> 004a72c2 0002cb62 000c675e 004adb58 0076f28a 005f3ce6 000000b6 00c63ef4 >>>>>>>>>>>>>> 00000310 00c63ef4 00000000 00000016 0076f23e 00c63f4c 00000010 00000004 >>>>>>>>>>>>>> 00000038 0000009a 01000000 00000000 00000000 00000000 000020e0 0076f23e >>>>>>>>>>>>>> Call Trace: [<004b9044>] dump_stack+0xc/0x10 >>>>>>>>>>>>>> [<004ae21e>] panic+0xc4/0x252 >>>>>>>>>>>>>> [<000c6974>] __kmem_cache_create_args+0x216/0x26c >>>>>>>>>>>>>> [<004a72c2>] strcpy+0x0/0x1c >>>>>>>>>>>>>> [<0002cb62>] parse_args+0x0/0x1f2 >>>>>>>>>>>>>> [<000c675e>] __kmem_cache_create_args+0x0/0x26c >>>>>>>>>>>>>> [<004adb58>] memset+0x0/0x8c >>>>>>>>>>>>>> [<0076f28a>] io_uring_init+0x4c/0xca >>>>>>>>>>>>>> [<0076f23e>] io_uring_init+0x0/0xca >>>>>>>>>>>>>> [<000020e0>] do_one_initcall+0x32/0x192 >>>>>>>>>>>>>> [<0076f23e>] io_uring_init+0x0/0xca >>>>>>>>>>>>>> [<0000211c>] do_one_initcall+0x6e/0x192 >>>>>>>>>>>>>> [<004a72c2>] strcpy+0x0/0x1c >>>>>>>>>>>>>> [<0002cb62>] parse_args+0x0/0x1f2 >>>>>>>>>>>>>> [<000020ae>] do_one_initcall+0x0/0x192 >>>>>>>>>>>>>> [<0075c4e2>] kernel_init_freeable+0x1a0/0x1a4 >>>>>>>>>>>>>> [<0076f23e>] io_uring_init+0x0/0xca >>>>>>>>>>>>>> [<004b911a>] kernel_init+0x0/0xec >>>>>>>>>>>>>> [<004b912e>] kernel_init+0x14/0xec >>>>>>>>>>>>>> [<004b911a>] kernel_init+0x0/0xec >>>>>>>>>>>>>> [<0000252c>] ret_from_kernel_thread+0xc/0x14 >>>>>>>>>>>>>> >>>>>>>>>>>>>> when trying to boot the m68k:q800 machine in qemu. >>>>>>>>>>>>>> >>>>>>>>>>>>>> An added debug message in create_cache() shows the reason: >>>>>>>>>>>>>> >>>>>>>>>>>>>> #### freeptr_offset=154 object_size=182 flags=0x310 aligned=0 sizeof(freeptr_t)=4 >>>>>>>>>>>>>> >>>>>>>>>>>>>> freeptr_offset would need to be 4-byte aligned but that is not the >>>>>>>>>>>>>> case on m68k. >>>>>>>>>>>>> >>>>>>>>>>>>> Why is ->work 2-byte aligned to begin with on m68k?! >>>>>>>>>>>> >>>>>>>>>>>> My understanding is that m68k does not align pointers. >>>>>>>>>>> >>>>>>>>>>> The minimum alignment for multi-byte integral values on m68k is >>>>>>>>>>> 2 bytes. >>>>>>>>>>> >>>>>>>>>>> See also the comment at >>>>>>>>>>> https://elixir.bootlin.com/linux/v6.12/source/include/linux/maple_tree.h#L46 >>>>>>>>>> >>>>>>>>>> Maybe it's time we put m68k to bed? :-) >>>>>>>>>> >>>>>>>>>> We can add a forced alignment ->work to be 4 bytes, won't change >>>>>>>>>> anything on anything remotely current. But does feel pretty hacky to >>>>>>>>>> need to align based on some ancient thing. >>>>>>>>> >>>>>>>>> Why does freeptr_offset need to be 4-byte aligned? >>>>>>>> >>>>>>>> Didn't check, but it's slab/slub complaining using a 2-byte aligned >>>>>>>> address for the free pointer offset. It's explicitly checking: >>>>>>>> >>>>>>>> /* If a custom freelist pointer is requested make sure it's sane. */ >>>>>>>> err = -EINVAL; >>>>>>>> if (args->use_freeptr_offset && >>>>>>>> (args->freeptr_offset >= object_size || >>>>>>>> !(flags & SLAB_TYPESAFE_BY_RCU) || >>>>>>>> !IS_ALIGNED(args->freeptr_offset, sizeof(freeptr_t)))) >>>>>>>> goto out; >>>>>>> >>>>>>> It is not guaranteed that alignof(freeptr_t) >= sizeof(freeptr_t) >>>>>>> (free_ptr is sort of a long). If freeptr_offset must be a multiple of >>>>>>> 4 or 8 bytes, >>>>>>> the code that assigns it must make sure that is true. >>>>>> >>>>>> Right, this is what the email is about... >>>>>> >>>>>>> I guess this is the code in fs/file_table.c: >>>>>>> >>>>>>> .freeptr_offset = offsetof(struct file, f_freeptr), >>>>>>> >>>>>>> which references: >>>>>>> >>>>>>> include/linux/fs.h: freeptr_t f_freeptr; >>>>>>> >>>>>>> I guess the simplest solution is to add an __aligned(sizeof(freeptr_t)) >>>>>>> (or __aligned(sizeof(long)) to the definition of freeptr_t: >>>>>>> >>>>>>> include/linux/slab.h:typedef struct { unsigned long v; } freeptr_t; >>>>>> >>>>>> It's not, it's struct io_kiocb->work, as per the stack trace in this >>>>>> email. >>>>> >>>>> Sorry, I was falling out of thin air into this thread... >>>>> >>>>> linux-next/master:io_uring/io_uring.c: .freeptr_offset = >>>>> offsetof(struct io_kiocb, work), >>>>> linux-next/master:io_uring/io_uring.c: .use_freeptr_offset = true, >>>>> >>>>> Apparently io_kiocb.work is of type struct io_wq_work, not freeptr_t? >>>>> Isn't that a bit error-prone, as the slab core code expects a freeptr_t? >>>> >>>> It just needs the space, should not matter otherwise. But may as well >>>> just add the union and align the freeptr so it stop complaining on m68k. >>> >>> Ala the below, perhaps alignment takes care of itself then? >>> >> >> No, that doesn't work (I tried), at least not on its own, because the pointer >> is still unaligned on m68k. > > Yeah we'll likely need to force it. The below should work, I pressume? > Feels pretty odd to have to align it to the size of it, when that should > naturally occur... Crusty legacy archs. > Yes, that works. Feel free to add Tested-by: Guenter Roeck to an official patch. Thanks, Guenter > diff --git a/include/linux/io_uring_types.h b/include/linux/io_uring_types.h > index 593c10a02144..8ed9c6923668 100644 > --- a/include/linux/io_uring_types.h > +++ b/include/linux/io_uring_types.h > @@ -674,7 +674,11 @@ struct io_kiocb { > struct io_kiocb *link; > /* custom credentials, valid IFF REQ_F_CREDS is set */ > const struct cred *creds; > - struct io_wq_work work; > + > + union { > + struct io_wq_work work; > + freeptr_t freeptr __aligned(sizeof(freeptr_t)); > + }; > > struct { > u64 extra1; > diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c > index 73af59863300..86ac7df2a601 100644 > --- a/io_uring/io_uring.c > +++ b/io_uring/io_uring.c > @@ -3812,7 +3812,7 @@ static int __init io_uring_init(void) > struct kmem_cache_args kmem_args = { > .useroffset = offsetof(struct io_kiocb, cmd.data), > .usersize = sizeof_field(struct io_kiocb, cmd.data), > - .freeptr_offset = offsetof(struct io_kiocb, work), > + .freeptr_offset = offsetof(struct io_kiocb, freeptr), > .use_freeptr_offset = true, > }; >