From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B5C2EC7EE29 for ; Mon, 29 May 2023 14:02:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=GUXsUQ+KuntGZmYREj29k9Gt5HSrFEBbbRm2aFwrYuw=; b=cvu7uUqZnj7XKn Z4U6v8pSPFA2iuSZD+rtGOkF/FsiT4zclLCldXs6XUDzJaG1lFCB2TlLr97iR2PBewhIHFWrtMsTH gqa55gPw0Y67nMKz8ItRLhrA5XkIKEaTjTBrSd7M9bTryRb5ICfyJ3abCd3ueGp7bvFFTmBJLO6zW JZHKNZ9DpC5Zcqu9mWN5mUs+udjAfy23KWDPvsrsSMLi7+iXXueJlrRL5iw43WPjyjNkTVTYeyeDz YWeXVKn19TF2AyjG/2kazdgT4MbxacpsjkWrZkNp7fm3s/dldBxX6LcrOSkEBK9wjLaZWhgu7F6im 3/ORq90Rj/U9Osiu+vIA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q3dRo-00AhdW-25; Mon, 29 May 2023 14:02:08 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q3dRn-00Ahcn-1T; Mon, 29 May 2023 14:02:07 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=8n/gSgUfVLp+2xUxKUXJObyidN3fOaenRgCYrh0plbg=; b=lDre3KycVopHJgQtSVi6Ft0h2+ /6KcXeh5DDgTYRWUam42o5WNWijcaqCZOd3dx2HAurqm8z1fldvnXLpCnoSy0NLLn08cXknKDuPGQ gYTInVr7Mv6sz5/UedpbbXKAgGCEtbEPUwJS3HU859+6q2mrf+Vst5r6bVYq4QYO4FOSwRHoda1Dn 5iV/2BvS3JTHI2796pUfUpALVlmDgyKCBvF/8JWEkyCLv2cJ9H9RqEbD681UXQ5f6iLi2mlHWJs6k +YJbLW+C+/rFR09hhGpAEembhtRGCh+/zp9btJ5yU++252/kk/VTdEAS56sP+b2VQVAXRo/gquNr/ Yo5hUC4w==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1q3dRi-005SM1-Ch; Mon, 29 May 2023 14:02:02 +0000 Date: Mon, 29 May 2023 15:02:02 +0100 From: Matthew Wilcox To: Hugh Dickins Cc: Andrew Morton , Mike Kravetz , Mike Rapoport , "Kirill A. Shutemov" , David Hildenbrand , Suren Baghdasaryan , Qi Zheng , Yang Shi , Mel Gorman , Peter Xu , Peter Zijlstra , Will Deacon , Yu Zhao , Alistair Popple , Ralph Campbell , Ira Weiny , Steven Price , SeongJae Park , Naoya Horiguchi , Christophe Leroy , Zack Rusin , Jason Gunthorpe , Axel Rasmussen , Anshuman Khandual , Pasha Tatashin , Miaohe Lin , Minchan Kim , Christoph Hellwig , Song Liu , Thomas Hellstrom , Russell King , "David S. Miller" , Michael Ellerman , "Aneesh Kumar K.V" , Heiko Carstens , Christian Borntraeger , Claudio Imbrenda , Alexander Gordeev , Jann Horn , linux-arm-kernel@lists.infradead.org, sparclinux@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH 05/12] powerpc: add pte_free_defer() for pgtables sharing page Message-ID: References: <35e983f5-7ed3-b310-d949-9ae8b130cdab@google.com> <28eb289f-ea2c-8eb9-63bb-9f7d7b9ccc11@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <28eb289f-ea2c-8eb9-63bb-9f7d7b9ccc11@google.com> X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Sun, May 28, 2023 at 11:20:21PM -0700, Hugh Dickins wrote: > +void pte_free_defer(struct mm_struct *mm, pgtable_t pgtable) > +{ > + struct page *page; > + > + page = virt_to_page(pgtable); > + call_rcu(&page->rcu_head, pte_free_now); > +} This can't be safe (on ppc). IIRC you might have up to 16x4k page tables sharing one 64kB page. So if you have two page tables from the same page being defer-freed simultaneously, you'll reuse the rcu_head and I cannot imagine things go well from that point. I have no idea how to solve this problem. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel