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 lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (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 9F704EB64DA for ; Thu, 6 Jul 2023 00:53:54 +0000 (UTC) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20221208 header.b=xC2HINTq; dkim-atps=neutral Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4QxJ1r5QhKz3bpC for ; Thu, 6 Jul 2023 10:53:52 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20221208 header.b=xC2HINTq; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=google.com (client-ip=2607:f8b0:4864:20::112e; helo=mail-yw1-x112e.google.com; envelope-from=hughd@google.com; receiver=lists.ozlabs.org) Received: from mail-yw1-x112e.google.com (mail-yw1-x112e.google.com [IPv6:2607:f8b0:4864:20::112e]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4QxJ0q1QWcz303Y for ; Thu, 6 Jul 2023 10:52:57 +1000 (AEST) Received: by mail-yw1-x112e.google.com with SMTP id 00721157ae682-5768a7e3adbso20064707b3.0 for ; Wed, 05 Jul 2023 17:52:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1688604771; x=1691196771; h=mime-version:references:message-id:in-reply-to:subject:cc:to:from :date:from:to:cc:subject:date:message-id:reply-to; bh=brYvfzxZIpzg2ekRWtSDETsKA5c6SQ0IrxunDSGxGEc=; b=xC2HINTq+WsZ6bkXuW3ZbQpuGJQPT0iM01isllTqlWtK8a2fGIX46T+CbpEjT8G16s qDwnKfQKJVRy3oyeXo3yIpwxKde63vyF9pF0VSWiUoHLL8dLOXgHf+38v8oCfcvJw4Er ejlXEu+OTpfpAhBvOyVGD80VixV4DfU44J6sigPGD6rA2/MjKGssOiRnE44ygD7T63vp t+E6BvJuJrICBNXpe1Szr6pynzSjeStiuBoj25z5M9pljiFW7x7bX1duA718XuUIxoIv aPIZ+mwTRAfYj6FjsOtWyUjzjmTTqQ+MgOlxxBZxAlxSWo3w6TfWylHqInFCKAu2bu68 t/Tg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688604771; x=1691196771; h=mime-version:references:message-id:in-reply-to:subject:cc:to:from :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=brYvfzxZIpzg2ekRWtSDETsKA5c6SQ0IrxunDSGxGEc=; b=V4Kb+MWsH6TGZBJXyaXw6/OBMGKz7CVigRnIaeXt7tpi2j83jcvSj8uyhrUAzrRV+f gpNj9D8GJAleDVxIkTMHaNh3ytc7thDoJhkL/eQ6olEOKXS39ziphQYx+q1n5TAUwm5U SpR3/LUI6ZH4ukE3w6kXalIIYIs8LHYKtHzFT876iVxzubywVSQhCxf4jQik0xwMNy5z 62QKN6iprpZm7h2gVcROaxK6o3+4UIVKSIVIef+8g6alukruzozfYcPi/CkQ4Xoq3SVh VVhVRuF6iAFmuX6lmu2usb3aS0Ke85pxcvlrf5z3uB0zn3oL2xji3SuYsEK+tNLimU4l 6IOQ== X-Gm-Message-State: ABy/qLYB8U/ZCUEdDaMnC+YQ5uLN2w8hkR/saw5Q/U2ZyolnDrGou431 Jr4l6jm/pylpoG3XLZSccqnZoA== X-Google-Smtp-Source: APBJJlGRAVoxAYVowQcijWwmVf4ESHfCTlO+TpznIilMWn3o7JH0E6ojbd/bR9jPjq/VIj7YN/NLDQ== X-Received: by 2002:a0d:dfca:0:b0:56c:fbd2:edec with SMTP id i193-20020a0ddfca000000b0056cfbd2edecmr557929ywe.6.1688604771513; Wed, 05 Jul 2023 17:52:51 -0700 (PDT) Received: from ripple.attlocal.net (172-10-233-147.lightspeed.sntcca.sbcglobal.net. [172.10.233.147]) by smtp.gmail.com with ESMTPSA id o207-20020a0dccd8000000b00568c1c919d2sm29463ywd.29.2023.07.05.17.52.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jul 2023 17:52:51 -0700 (PDT) Date: Wed, 5 Jul 2023 17:52:40 -0700 (PDT) From: Hugh Dickins X-X-Sender: hugh@ripple.attlocal.net To: Alexander Gordeev Subject: Re: [PATCH v2 07/12] s390: add pte_free_defer() for pgtables sharing page In-Reply-To: Message-ID: <8c6a4a46-2d17-8cfb-50f-f89f1d44973f@google.com> References: <54cb04f-3762-987f-8294-91dafd8ebfb0@google.com> <20230628211624.531cdc58@thinkpad-T15> <20230629175645.7654d0a8@thinkpad-T15> <7bef5695-fa4a-7215-7e9d-d4a83161c7ab@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Miaohe Lin , David Hildenbrand , Peter Zijlstra , Yang Shi , Peter Xu , linux-kernel@vger.kernel.org, Song Liu , sparclinux@vger.kernel.org, Claudio Imbrenda , Will Deacon , linux-s390@vger.kernel.org, Yu Zhao , Ira Weiny , Alistair Popple , Hugh Dickins , Russell King , Matthew Wilcox , Steven Price , Christoph Hellwig , Jason Gunthorpe , "Aneesh Kumar K.V" , Huang Ying , Axel Rasmussen , Gerald Schaefer , Christian Borntraeger , Thomas Hellstrom , Ralph Campbell , Pasha Tatashin , Vasily Gorbik , Anshuman Khandual , Heiko Carstens , Qi Zheng , Suren Baghdasaryan , Vlastimil Babka , linux-arm-kernel@lists.infradead.org, SeongJae Park , Lorenzo Stoakes , Jann Horn , linux-mm@kvack.org, linuxppc-dev@lists.ozlabs.org, Naoya Horiguchi , Zack Rusin , Vishal Moola , Minchan Kim , Mike Rapoport , Andrew Morton , Mel Gorman , "David S. Miller" , "Kirill A. Shutemov" , Mike Kravetz Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Wed, 5 Jul 2023, Alexander Gordeev wrote: > On Sat, Jul 01, 2023 at 09:32:38PM -0700, Hugh Dickins wrote: > > On Thu, 29 Jun 2023, Hugh Dickins wrote: > > Hi Hugh, > > ... > > > +#ifdef CONFIG_TRANSPARENT_HUGEPAGE > > +void pte_free_defer(struct mm_struct *mm, pgtable_t pgtable) > > +{ > > + struct page *page; > > If I got your and Claudio conversation right, you were going to add > here WARN_ON_ONCE() in case of mm_alloc_pgste(mm)? Well, Claudio approved, so I would have put it in, if we had stuck with that version which had "if (mm_alloc_pgste(mm)) {" in pte_free_defer(); but once that went away, it became somewhat irrelevant... to me anyway. But I don't mind adding it here, in the v3 I'll post when -rc1 is out, if it might help you guys - there is some point, since pte_free_defer() is a route which can usefully check for such a case, without confusion from harmless traffic from immediate frees of just-in-case allocations. But don't expect it to catch all such cases (if they exist): another category of s390 page_table_free()s comes from the PageAnon zap_deposited_table() in zap_huge_pmd(): those tables might or might not have been exposed to userspace at some time in the past. I'll add the WARN_ON_ONCE in pte_free_defer() (after checking that WARN_ON_ONCE is the one we want - I get confused by all the different flavours of WARN, and have to check the header file each time to be sure of the syntax and semantics): but be aware that it won't be checking all potential cases. Hugh > > > + page = virt_to_page(pgtable); > > + SetPageActive(page); > > + page_table_free(mm, (unsigned long *)pgtable); > > +} > > +#endif /* CONFIG_TRANSPARENT_HUGEPAGE */ > > + > > /* > > * Base infrastructure required to generate basic asces, region, segment, > > * and page tables that do not make use of enhanced features like EDAT1. > > Thanks!