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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 98FC1C433FE for ; Thu, 24 Feb 2022 17:41:27 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 269E98D0003; Thu, 24 Feb 2022 12:41:27 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 1F1FE8D0001; Thu, 24 Feb 2022 12:41:27 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 06BD98D0003; Thu, 24 Feb 2022 12:41:27 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0195.hostedemail.com [216.40.44.195]) by kanga.kvack.org (Postfix) with ESMTP id EB74E8D0001 for ; Thu, 24 Feb 2022 12:41:26 -0500 (EST) Received: from smtpin27.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id B00B3181C9BAD for ; Thu, 24 Feb 2022 17:41:26 +0000 (UTC) X-FDA: 79178390172.27.DCBBCDC Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf20.hostedemail.com (Postfix) with ESMTP id 888981C000E for ; Thu, 24 Feb 2022 17:41:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645724485; 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=ZU9kCOEHshly2VLC25A2iAx+V2sxN9EfZxvkNN9yrms=; b=Sv+5du1HlrLSQ0MR8fjy7IowDwcktupQcX/6rkTAD0QLeg1moYN9uAzW2/0AAP1jktrq5g jie5hJBiHTmGcHMMYrSK2mNd468f4LKcrdKzmmuWsxLYuxCYebCDiH6s/f+Ny4WrQ3HBYg XFey3NsR7IKR8xZOPzryH46PivfcfC4= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-581-nHbtaGmnNmKXxdzv8u7Lfw-1; Thu, 24 Feb 2022 12:41:23 -0500 X-MC-Unique: nHbtaGmnNmKXxdzv8u7Lfw-1 Received: by mail-wr1-f69.google.com with SMTP id v24-20020adf8b58000000b001eda5c5cf95so178240wra.18 for ; Thu, 24 Feb 2022 09:41:23 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:organization:in-reply-to :content-transfer-encoding; bh=ZU9kCOEHshly2VLC25A2iAx+V2sxN9EfZxvkNN9yrms=; b=hY9BnY+Dnq+UiYvaChmYSdtEGtMXYDZR81cKcx+AXNGwp2aSQmqRBWpe9qtgUGJOHI BGv3OXORAVEf5dDRmdCINENDSy2r/MDyGQO7G+4KUKI933DpaF9yQlR0FP6N1f30O61d zNENHeFoGqsuqKRukH8qlvPPB1oQMshOWI2JlpdvkoQUx1TwovaEqWlxLBXvNsnjy9eO avc6IDxv6NWoHx1mqaixVy3LAtC0yDwsOfvKMwF70LthCEHVOWX8DDm31ragriB501Bf eL/0NgoasXo+qezJDlIwUQoqsRid9UTlf4gQLwFw14BC963EUiFM2d1WnLipNnYZvFof DlTw== X-Gm-Message-State: AOAM532HnSD1w/mG5ALiy4EXX4SMpudiFAl6sM5530oFs/BWQNlXUAwj xzBtWQNzWxrtGfQPRLjepWppP3pvG/2NsIC3yjsa7jnJRGJFSSWtsUyqBkx4NliVzoqBljtz/Jl UcFYKmDamD3M= X-Received: by 2002:adf:f303:0:b0:1e7:aeab:ac6a with SMTP id i3-20020adff303000000b001e7aeabac6amr3174580wro.40.1645724482696; Thu, 24 Feb 2022 09:41:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJyoXj2qud3pWml5ibfeTWdxFb8Sfw0Iq1KADIMiB6CiEFIvJWGtEasuaviJonK9ozqG8TX6cw== X-Received: by 2002:adf:f303:0:b0:1e7:aeab:ac6a with SMTP id i3-20020adff303000000b001e7aeabac6amr3174544wro.40.1645724482379; Thu, 24 Feb 2022 09:41:22 -0800 (PST) Received: from ?IPV6:2003:cb:c707:4900:ccb0:e874:2bce:973b? (p200300cbc7074900ccb0e8742bce973b.dip0.t-ipconnect.de. [2003:cb:c707:4900:ccb0:e874:2bce:973b]) by smtp.gmail.com with ESMTPSA id q17-20020adfc511000000b001edc0a8a8b6sm62431wrf.0.2022.02.24.09.41.20 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 24 Feb 2022 09:41:21 -0800 (PST) Message-ID: <064ba776-e6c6-a430-7d74-0b691123e2a9@redhat.com> Date: Thu, 24 Feb 2022 18:41:20 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [PATCH RFC 05/13] mm/rmap: remove do_page_add_anon_rmap() To: Linus Torvalds Cc: Linux Kernel Mailing List , Andrew Morton , Hugh Dickins , David Rientjes , Shakeel Butt , John Hubbard , Jason Gunthorpe , Mike Kravetz , Mike Rapoport , Yang Shi , "Kirill A . Shutemov" , Matthew Wilcox , Vlastimil Babka , Jann Horn , Michal Hocko , Nadav Amit , Rik van Riel , Roman Gushchin , Andrea Arcangeli , Peter Xu , Donald Dutile , Christoph Hellwig , Oleg Nesterov , Jan Kara , Liang Zhang , Pedro Gomes , Oded Gabbay , Linux-MM References: <20220224122614.94921-1-david@redhat.com> <20220224122614.94921-6-david@redhat.com> From: David Hildenbrand Organization: Red Hat In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 888981C000E X-Stat-Signature: yr5idfk7dgb8jhqxcr17hqhfwgytwomm Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Sv+5du1H; spf=none (imf20.hostedemail.com: domain of david@redhat.com has no SPF policy when checking 170.10.129.124) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-HE-Tag: 1645724485-877545 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 24.02.22 18:29, Linus Torvalds wrote: > On Thu, Feb 24, 2022 at 4:29 AM David Hildenbrand wrote: >> >> ... and instead convert page_add_anon_rmap() to accept flags. > > Can you fix the comment above the RMAP_xyz definitions? That one still says > > /* bitflags for do_page_add_anon_rmap() */ > > that tnow no longer exists. Oh, yes sure. > > Also, while this kind of code isn't unusual, I think it's still confusing: > >> + page_add_anon_rmap(page, vma, addr, 0); > > because when reading that, at least I go "what does 0 mean? Is it a > page offset, or what?" Yes, I agree. > > It might be a good idea to simply add a > > #define RMAP_PAGE 0x00 > > or something like that, just to have the callers all make it obvious > that we're talking about that RMAP_xyz bits - even if some of them may > be default. > > (Then using an enum of a special type is something we do if we want to > add extra clarity or sparse testing, I don't think there are enough > users for that to make sense) > Actually, I thought about doing it similarly to what I did in page_alloc.c with fpi_t: typedef int __bitwise fpi_t; #define FPI_NONE ((__force fpi_t)0) I can do something similar here. -- Thanks, David / dhildenb