Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1309947rwd; Sun, 14 May 2023 17:23:30 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ53QNrRMw8whHeSk6oitUsM5t/UKVZQdGxnUZjGmDHpVZxlGxpVgmpLqao0xQZBH4osWhGH X-Received: by 2002:a05:6a20:6a1a:b0:104:2200:8933 with SMTP id p26-20020a056a206a1a00b0010422008933mr14781970pzk.62.1684110209941; Sun, 14 May 2023 17:23:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684110209; cv=none; d=google.com; s=arc-20160816; b=kGTATKAca8gi5zKMqw/2TGyhB/7m718hm5BzYDAj1H7UCdvc05Ut21DHtZTZkqp4vL I8KR9UzIFFvtcCOcjA1RPZTbL5zNNzKcLvH42bkYu+/aSIrMne7XXPrP2Q9ZkaLbVGI2 GEoPWhDI/pHq0rfKJ2tXCXA+okL9DsZpqo9Ppr5KW4a4/9fzZJ8QyzVg779vcj9zzMEb N2MuuNq+1pk8zbRU8Ae+aZmd5rXtj92mbfkvVX6QoVWs8bhINcER+u287ndyYG+uHD03 VmeA5Pk3wi02/dvUOHalpKkSgtP/vIJz7e1jAMr3w3ztyeBw67Ttk3dU7rHCbggzWL5O KiVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:dkim-signature:date; bh=mggwEpH/XfQSgikEQX+k7jG5jsZJxafKLG7tZ7lLfpw=; b=eh4ltpLjKtHIxh7v674CZUBV2JIZvK/bPG/mg36//vhCXa/AeP7Elh4am9eCWkcUqe qSfsW5rbgnVIrQI3xP17JOeNsZsbyl8HFqOL80d28Gtk+lm10ZtwU25S3+5Bob3z6snw tXjMyzxwtrcSwTksZ4X0VIeeUihMiKJbT7g+86zQQ2+F0jRDdxOPJJQpH++WWBNFnIIH elN05jlvN7mXRXnokmm6Sh16Oan78WuP+fx93JZXuvFWbV8AHCCucqK243AQEDQP0C0e 04hZZARi2b3GJwLbGo1KY9vTaVSa9V1aWLtMJbKskTOPMEMpTI8sUgA9A/U+N5uI56xt R4Dw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=OobDuuQT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a138-20020a621a90000000b0063d289b8d47si15429265pfa.126.2023.05.14.17.23.16; Sun, 14 May 2023 17:23:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=OobDuuQT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229539AbjENXnf (ORCPT + 99 others); Sun, 14 May 2023 19:43:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46630 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229797AbjENXne (ORCPT ); Sun, 14 May 2023 19:43:34 -0400 Received: from out-46.mta1.migadu.com (out-46.mta1.migadu.com [IPv6:2001:41d0:203:375::2e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D531E10E7 for ; Sun, 14 May 2023 16:43:31 -0700 (PDT) Date: Sun, 14 May 2023 19:43:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1684107809; 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=mggwEpH/XfQSgikEQX+k7jG5jsZJxafKLG7tZ7lLfpw=; b=OobDuuQTCFp7GRpcbbdm5KWHoEDDSxa6orNliLPqe6jh/lLy2gYgq3nnBl6YmX2w0KPz6o tUCwQ8VtQY6HHlqkOtt3I++X1mDl00GGgKEjaAT+6pfgUJE72HPUtYI5rX018dKoR44SJA 0g2A4B9Z9yGIXTzH0S3Wq70l1qJu4NM= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Kent Overstreet To: Christophe Leroy Cc: Lorenzo Stoakes , Christoph Hellwig , "linux-kernel@vger.kernel.org" , "linux-fsdevel@vger.kernel.org" , "linux-bcachefs@vger.kernel.org" , Kent Overstreet , Andrew Morton , Uladzislau Rezki , "linux-mm@kvack.org" Subject: Re: [PATCH 07/32] mm: Bring back vmalloc_exec Message-ID: References: <20230509165657.1735798-1-kent.overstreet@linux.dev> <20230509165657.1735798-8-kent.overstreet@linux.dev> <8f76b8c2-f59d-43fc-9613-bb094e53fb16@lucifer.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Migadu-Flow: FLOW_OUT X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, May 14, 2023 at 06:39:00PM +0000, Christophe Leroy wrote: > I addition to that, I still don't understand why you bring back > vmalloc_exec() instead of using module_alloc(). > > As reminded in a previous response, some architectures like powerpc/32s > cannot allocate exec memory in vmalloc space. On powerpc this is because > exec protection is performed on 256Mbytes segments and vmalloc space is > flagged non-exec. Some other architectures have a constraint on distance > between kernel core text and other text. > > Today you have for instance kprobes in the kernel that need dynamic exec > memory. It uses module_alloc() to get it. On some architectures you also > have ftrace that gets some exec memory with module_alloc(). > > So, I still don't understand why you cannot use module_alloc() and need > vmalloc_exec() instead. Because I didn't know about it :) Looks like that is indeed the appropriate interface (if a bit poorly named), I'll switch to using that, thanks. It'll still need to be exported, but it looks like the W|X attribute discussion is not really germane here since it's what other in kernel users are using, and there's nothing particularly special about how bcachefs is using it compared to them.