Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp399297rwb; Wed, 16 Nov 2022 02:13:15 -0800 (PST) X-Google-Smtp-Source: AA0mqf5RJRmNz8dkiaWlOvMac0W14/ncsrd+sbsUAe0Nz0m9QWU0y5EMDExILLnFGT8aPuoNMb0L X-Received: by 2002:a05:6402:5511:b0:468:dc9:ec08 with SMTP id fi17-20020a056402551100b004680dc9ec08mr8887096edb.17.1668593594926; Wed, 16 Nov 2022 02:13:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668593594; cv=none; d=google.com; s=arc-20160816; b=ywszAZY0QnnsGeD0DL1qmlLni6AJsotcPkri3Hur0FencKZyebOvhSWFhEkhEu2fO3 DTegu5odpHoe7rHgPo51Z/StJmBR47uvZ5jIYq83d7co6L2iHnX8qxodrFIDGjEkEU57 SDya6X9X67prmwB0zwDYazY+FRk/CHYJi5XMphf9d7xQ/H5/7juMASJBB5APoWj5OJaz 8GfVEmqYzr0/BOUE4Yse8YncXtsTpqocp1toP3g8Nk5kO2yWOuQvI5p3GoTekz8RlW1A TeiymSlOiII3n5XN3mUYOemW8C3AZV0/1AalIoBsRHbNUCLfM0/qJwJY4LNOhhPGTSun gmvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :organization:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:dkim-signature; bh=iBg0vpR79ykrWg7W6yFVkquAa8QDFi53cO5reZCSm2w=; b=EIXGwbRmRJKgMULqcWVOSPgwuQLGqRS4zPuQL3NsOjPJy+Rlv8B1wnJmJaYCPguxfv ba3+ZdR7+Bdj3R/YTvQVO8Vh1fp8hV82DWMKQyt608+AIfSzV9vlhsCqFAG+lWDF/Nz6 C/Kla4ihBP2ErFsPPeGuh8IR8vteqXL7w/njhJVuzmae8pFGA30Ncih+6B50AdumKVU5 5UYbbVp7S4zHHbOAHg3YJS/etEeFCB6wt2zyFSKmTgbhqNjZzwYIH+lZhv1glrUDD3U9 JZqw8dqDUxskxA7fJMaG4lioDT1UpETH7UQTcxubcehMdBgsJNNROqZ5SMUPK+BVtb3G 0LDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=WsLUMYAr; 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=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id oz43-20020a1709077dab00b007ae0211844dsi14937536ejc.937.2022.11.16.02.12.51; Wed, 16 Nov 2022 02:13:14 -0800 (PST) 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=@redhat.com header.s=mimecast20190719 header.b=WsLUMYAr; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232571AbiKPJZ5 (ORCPT + 91 others); Wed, 16 Nov 2022 04:25:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47988 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232688AbiKPJZz (ORCPT ); Wed, 16 Nov 2022 04:25:55 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4FC4F6240 for ; Wed, 16 Nov 2022 01:24:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1668590691; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=iBg0vpR79ykrWg7W6yFVkquAa8QDFi53cO5reZCSm2w=; b=WsLUMYArQTmmG2/5U2O++z89P+bY3Wtkz3/KBQlRqjKcVKHwM9bhlgKAFsNpcdk3HpHB0w GcAeEyNZDy2NrZrEWqmkI55Cei2aVxxyQ+0J7RELSuhW2ExG4JXkvCbiNa2XMrQAVhHOdA nDFmN/A/jHe/dcL42/c8+KK18TKR6hU= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-134-U4nOe68LMW2i8Xog-Z9oJg-1; Wed, 16 Nov 2022 04:24:50 -0500 X-MC-Unique: U4nOe68LMW2i8Xog-Z9oJg-1 Received: by mail-wr1-f70.google.com with SMTP id v14-20020adf8b4e000000b0024174021277so2716861wra.13 for ; Wed, 16 Nov 2022 01:24:50 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=iBg0vpR79ykrWg7W6yFVkquAa8QDFi53cO5reZCSm2w=; b=0BvXiaXVjPkCJAXS70st7qhl+GVKolKSwghzoKADLnO9X6NalnszCrUBaU6geqKNjo 3o9FH/CGndFHRrUxu0F2dRdquY9+8Cz54ulaxQk0a/8vv7GpQ44jBG4nl6byflGibDSF NjfqDUGPSz73Bk8Ng/hgRD1R21e4cph4JqTI3DeVSbdmJ52sLL3c2zkIXECthrxQHSlf hMf+yf63wuzrtRDCqlFBv1NgenrmZu2Jw+DVQfPHKnKWcOuv/AtFsRqz9L6nGvJUZOn5 SMWD116Cw8YuiHvbJ17o1kWCAUoW4F/6RXtvPsc2wu1Qijw1g5phqMK9wd+815oyQfye /mBQ== X-Gm-Message-State: ANoB5pnmTuWV+G+e5mFI8ozFnD++90973KVK8VDeBjfVlQQak192HAPF +oYrhjCe+OPoxJ80vIrG5rli276fKitUer+3lvZ0iGiPHOwYmM8o4oCAT6KjO4eZOmIyn6IDxvK m9gv04Nm3yLxPCM54M7KgVEaX X-Received: by 2002:a5d:6743:0:b0:22e:28fe:39d6 with SMTP id l3-20020a5d6743000000b0022e28fe39d6mr13359758wrw.701.1668590689126; Wed, 16 Nov 2022 01:24:49 -0800 (PST) X-Received: by 2002:a5d:6743:0:b0:22e:28fe:39d6 with SMTP id l3-20020a5d6743000000b0022e28fe39d6mr13359744wrw.701.1668590688833; Wed, 16 Nov 2022 01:24:48 -0800 (PST) Received: from ?IPV6:2003:cb:c704:9f00:a98d:4026:7c44:40fd? (p200300cbc7049f00a98d40267c4440fd.dip0.t-ipconnect.de. [2003:cb:c704:9f00:a98d:4026:7c44:40fd]) by smtp.gmail.com with ESMTPSA id h16-20020a05600c315000b003cff309807esm1263398wmo.23.2022.11.16.01.24.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 16 Nov 2022 01:24:48 -0800 (PST) Message-ID: Date: Wed, 16 Nov 2022 10:24:47 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.1 Subject: Re: [PATCH 2/4] mm: teach release_pages() to take an array of encoded page pointers too Content-Language: en-US To: Linus Torvalds , Hugh Dickins , Johannes Weiner , Andrew Morton Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org References: <20221109203051.1835763-1-torvalds@linux-foundation.org> <20221109203051.1835763-2-torvalds@linux-foundation.org> From: David Hildenbrand Organization: Red Hat In-Reply-To: <20221109203051.1835763-2-torvalds@linux-foundation.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE 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 09.11.22 21:30, Linus Torvalds wrote: > release_pages() already could take either an array of page pointers, or > an array of folio pointers. Expand it to also accept an array of > encoded page pointers, which is what both the existing mlock() use and > the upcoming mmu_gather use of encoded page pointers wants. > > Note that release_pages() won't actually use, or react to, any extra > encoded bits. Instead, this is very much a case of "I have walked the > array of encoded pages and done everything the extra bits tell me to do, > now release it all". > > Also, while the "either page or folio pointers" dual use was handled > with a cast of the pointer in "release_folios()", this takes a slightly > different approach and uses the "transparent union" attribute to > describe the set of arguments to the function: > > https://gcc.gnu.org/onlinedocs/gcc/Common-Type-Attributes.html > > which has been supported by gcc forever, but the kernel hasn't used > before. > > That allows us to avoid using various wrappers with casts, and just use > the same function regardless of use. > > Acked-by: Johannes Weiner > Acked-by: Hugh Dickins > Signed-off-by: Linus Torvalds > --- Reviewed-by: David Hildenbrand -- Thanks, David / dhildenb