Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp9067412rwr; Thu, 11 May 2023 09:30:54 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5uBUqReirBFzIwrg5mI3OquRKEkW86reuJt4K3vjkFtIx4aLZVixBuN8tarwBjhHHORxEs X-Received: by 2002:a17:90b:3b8b:b0:252:7114:b37a with SMTP id pc11-20020a17090b3b8b00b002527114b37amr5256490pjb.47.1683822653831; Thu, 11 May 2023 09:30:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683822653; cv=none; d=google.com; s=arc-20160816; b=d9WBgagnuHtgKSQm1MIVvUAwwvXvOgIbDnT1JKcvvIsDYnbtt6V+e023XxVpwiCDqI cqiAJYdPjnjFaWyW8w0o9Jv/j3NXvyWBqbD5eAdHjPrAJhd3ejNhsKFohDhc0c7h1tKM 0fVlxBspNUHgjDIDQP53IuhfiKQ3Kp2pl+2JfxgZNV2KV69TbcA3OuxLo99ulyRuWzvL 67kf1c5DNlaNsVZ+7FdId1pGT3+MdRzO+XSpxy26iYBaWTMDayPPAsjZiz3j9KSaDOo5 1d3KRCZLhuD8s0HMkdYfM7i0WV47KjMxakpmaZbbB38+CRnPtqFiedrH2aaWQalApTPl 7Gxw== 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:date:dkim-signature; bh=T46lKjyksdSH1mMWMKwFyNNuZqIq3bsgJShvfu2imFw=; b=r/7FE6KS9ZhwX3gK0nQLLY0w5ymwRr2atdZFNnVBgTClsGSOwtlHDo4F+wS4PJ77VW /gWqj7fBzk/doIqQ5+MAs2wtE+V74AJ3gNU0WxvS2JAGRtkiTDDuq4UAA2Z1JVDzfmQM heLR8LWkaghHhwuG761R/0b7fRT9uPcIY+I4tCeET9c+HUEefqMm4caBPzbN/nWby84e PvoOdnMoMu5NJfLqR4bjgaJR939sqoCrX0Lx2N1CaEr6PbguGFH8Nt9xpT6vrPI2abco yytDrIQ9k7yuwY0zgsXO8dZ3WjdZHAFzkmkgEerqwIRDc24vcZC6Yi0uSyTy1Oxdhb9q rUEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@pku.edu.cn header.s=dkim header.b=EYxzrv7y; 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=pku.edu.cn Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r14-20020a17090a690e00b0024e12c5724esi24516667pjj.40.2023.05.11.09.30.37; Thu, 11 May 2023 09:30:53 -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 (test mode) header.i=@pku.edu.cn header.s=dkim header.b=EYxzrv7y; 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=pku.edu.cn Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238779AbjEKQTd (ORCPT + 99 others); Thu, 11 May 2023 12:19:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35804 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238204AbjEKQTc (ORCPT ); Thu, 11 May 2023 12:19:32 -0400 Received: from pku.edu.cn (mx19.pku.edu.cn [162.105.129.182]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 69EE3E70; Thu, 11 May 2023 09:19:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pku.edu.cn; s=dkim; h=Received:Date:From:To:Cc:Subject: Message-ID:References:MIME-Version:Content-Type: Content-Disposition:In-Reply-To; bh=T46lKjyksdSH1mMWMKwFyNNuZqIq 3bsgJShvfu2imFw=; b=EYxzrv7yMThObCD2fNLyafIhForMgk7uoc+tziV+8jNF hQWhx+2nWjh/PPfagI73Jl3svDIVmHR8Gtjt0SIe9CS0V04XGTWr8DudC/nYsAle huohL4AKMJo2DMsSrr9HqSlPk5TPxNazbbZiUC8Nq/XpaFEaAdn1BACFDYW4mJ0= Received: from localhost (unknown [10.7.101.92]) by front02 (Coremail) with SMTP id 54FpogCXbjh9FV1kchqUEw--.22912S2; Fri, 12 May 2023 00:19:15 +0800 (CST) Date: Fri, 12 May 2023 00:19:09 +0800 From: Ruihan Li To: Christoph Hellwig Cc: Greg Kroah-Hartman , linux-mm@kvack.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Pasha Tatashin , David Hildenbrand , Matthew Wilcox , Andrew Morton , Ruihan Li Subject: Re: [PATCH 0/4] Fix type confusion in page_table_check Message-ID: References: <20230510085527.57953-1-lrh2000@pku.edu.cn> <2023051108-lens-unsocial-8425@gregkh> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-CM-TRANSID: 54FpogCXbjh9FV1kchqUEw--.22912S2 X-Coremail-Antispam: 1UD129KBjvdXoWrtFy5uF4kXw15Cr4UCr17KFg_yoWDCFgE9F yDKFnF93yDJa13tr43tF4IqrZ3KF4kXF10vFZYqr4IkF98XF97t3WkGrnrZF1xGw4Fva45 Crnaya42vr12qjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbSkFc2x0x2IEx4CE42xK8VAvwI8IcIk0rVWrJVCq3wAFIxvE14AK wVWUJVWUGwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK021l84ACjcxK6xIIjxv20x vE14v26w1j6s0DM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26r4UJVWxJr1l84ACjcxK6I8E 87Iv67AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVCY1x0267AKxVW8Jr0_Cr1UM2vYz4IE04 k24VAvwVAKI4IrM2AIxVAIcxkEcVAq07x20xvEncxIr21l5I8CrVACY4xI64kE6c02F40E x7xfMcIj6xIIjxv20xvE14v26r106r15McIj6I8E87Iv67AKxVWUJVW8JwAm72CE4IkC6x 0Yz7v_Jr0_Gr1lF7xvr2IY64vIr41lF7I21c0EjII2zVCS5cI20VAGYxC7M4IIrI8v6xkF 7I0E8cxan2IY04v7MxkIecxEwVCm-wCF04k20xvY0x0EwIxGrwCF04k20xvE74AGY7Cv6c x26w4UJr1UMxC20s026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2Iq xVCjr7xvwVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWUtVW8ZwCIc40Y0x0EwIxGrwCI42 IY6xIIjxv20xvE14v26r1j6r1xMIIF0xvE2Ix0cI8IcVCY1x0267AKxVW8JVWxJwCI42IY 6xAIw20EY4v20xvaj40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Jr0_Gr1lIxAIcVC2z280aV CY1x0267AKxVW8JVW8JrUvcSsGvfC2KfnxnUUI43ZEXa7VU1c4S5UUUUU== X-CM-SenderInfo: yssqiiarrvmko6sn3hxhgxhubq/1tbiAgEHBVPy772BUwARsx X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, 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 Thu, May 11, 2023 at 08:32:01AM -0700, Christoph Hellwig wrote: > On Thu, May 11, 2023 at 09:44:55PM +0800, Ruihan Li wrote: > > Christoph's patch perfectly fixes _one_ problem: kmalloc'ed memory > > cannot be mapped to user space. However, as I detailed in the commit > > message, this series of patches fixes _three_ problems. > > FYI, I agree with you. My simple patch was sent before reading > your new series, and is a strict subset of it. Thank you for the clarification. > > I have to say that the original code is quite buggy. In the > > gen_pool_dma_alloc path, there is no guarantee of page alignment. > > I also find this whole interface very problematic to start with, > but that's a separate discussion for later. Yes. I don't think hybrid allocation of DMA memory and normal memory in one function is a good thing, but currently there is no clear way to fix this. Mixing memory allocation and page allocation is another bad thing, and at least, my patch can (hopefully) solve the second (and much easier) issue. Thanks, Ruihan Li