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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id C4BF1C433FE for ; Wed, 16 Nov 2022 09:24:55 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 46F0E6B0071; Wed, 16 Nov 2022 04:24:55 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 41F916B0072; Wed, 16 Nov 2022 04:24:55 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2BFEA8E0001; Wed, 16 Nov 2022 04:24:55 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 197296B0071 for ; Wed, 16 Nov 2022 04:24:55 -0500 (EST) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id E0544AB528 for ; Wed, 16 Nov 2022 09:24:54 +0000 (UTC) X-FDA: 80138770908.14.25532D4 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf18.hostedemail.com (Postfix) with ESMTP id E1F511C000B for ; Wed, 16 Nov 2022 09:24:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1668590692; 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=KZHsediRrvH5sO9AdAgc6c3nqiQ3CM4nm+dJ7irX+iHV1BCKbszvrGucv2XK14OmMuGpi0 wGerqdeZj0eDH+DjQjNBeYT8FABCFYNorSKBEFEUiwjWRCMhMMJ70BMHuChClnbEIXke5r OkfFkLAfIXLtMoyNf1P8CrKE0gvhreY= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-346-wCP3ei_fNiqrbL_7_CVTkg-1; Wed, 16 Nov 2022 04:24:50 -0500 X-MC-Unique: wCP3ei_fNiqrbL_7_CVTkg-1 Received: by mail-wm1-f69.google.com with SMTP id c1-20020a7bc001000000b003cfe40fca79so287781wmb.6 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=RBbEO+1fTADrhCAMY3wWLrW2f7IR4Gdbm6yeg0MLW68YYlYaR3A3vOxy+CNZ41/tw5 IdmlIOaFyobd8KulJUcnWfpjSDyngwycb3ih69D4viVm+xP415r4ZqlIBa/B11tyvrt8 UJxzcOidhrYa+kpdfrnuP8Baw33PqKeGk0U7NDq9JCCqm68PoOQ4yRazlal8NFdOSfeT 96fH3aI2ZH67ez/kcLvH89YQx/fcNonOxIk4NCVp/P/7R6ULmctDUGDr4p4kE496gAlm N2MSvY4hDCVanvspZT8vFa0T3CxNcHyaNzyrUtTPR1TqvlCNFDyWYB57NR+VaS17rzMq +tsw== X-Gm-Message-State: ANoB5pmFASBuQSwFFMDRuyh2gat6BQvl4lOL3TjjIHSZ9DDO31M9dzq5 a0ynIV9rM5niw2RksATI061EFvmp7SxAdndBseedI4AxxqRLHNqPMqZdF1UopZJcBna5aIxI2Dt GYVQty6TPnZ0= X-Received: by 2002:a5d:6743:0:b0:22e:28fe:39d6 with SMTP id l3-20020a5d6743000000b0022e28fe39d6mr13359756wrw.701.1668590689124; Wed, 16 Nov 2022 01:24:49 -0800 (PST) X-Google-Smtp-Source: AA0mqf4VFuyxwMjEQ9LcEB4erUpRK2y3OS4R2z2ooCMN1U5iH5mRvOiSincwS1V5ESg00uTHpGDJcw== 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 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> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1668590694; a=rsa-sha256; cv=none; b=V9vw70tMPrjF8UiYVXMlKfyUhdXsISQcBv4Bn6FB9WUgbjH8OHVEKboJKzEeuJy11Rm+pX PK/SIoegEoy2KCr0Fmonw8AWb7kLtbrQcLOtv7QYV9a8nWYX+cVzKYu+PHN3uHfe0AQJ+j Qgw/Gwuy6QihVAymXoeBGda5bIUGUrE= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=KZHsediR; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf18.hostedemail.com: domain of david@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=david@redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1668590694; h=from:from:sender: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:dkim-signature; bh=iBg0vpR79ykrWg7W6yFVkquAa8QDFi53cO5reZCSm2w=; b=vTYgCbnb6RbKE2zmLHdg1Na0GNExq1OAkICaJpK9EKZP3OPzCM5ohuh2SlengiXmmFTc+y F8X1bNmh490lTg333R5Os+QX2kJybd3WYCkatbSJZjdwpOVCX9nyYA9URJ/7HG7WeXfDNr PFbwWWrKhoQLQ2ICEChgJB0Wb6H3YQA= X-Rspam-User: Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=KZHsediR; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf18.hostedemail.com: domain of david@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=david@redhat.com X-Rspamd-Server: rspam02 X-Stat-Signature: qfekdbyggrdgpjs1jfnaqoo3gudmbmh6 X-Rspamd-Queue-Id: E1F511C000B X-HE-Tag: 1668590692-783184 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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