Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp1312051rwl; Thu, 5 Jan 2023 11:38:46 -0800 (PST) X-Google-Smtp-Source: AMrXdXt/s3PGeuHMgsS8J7B5VVotmXpiJIhEFH6sj1MmSMKyquWEMsO40FSKYwjjcNWKpBNKzPJJ X-Received: by 2002:a17:906:79d2:b0:7ae:987d:d7f9 with SMTP id m18-20020a17090679d200b007ae987dd7f9mr40919456ejo.17.1672947526066; Thu, 05 Jan 2023 11:38:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672947526; cv=none; d=google.com; s=arc-20160816; b=hTp+FOV5Ivxa4xR97x+4R5h11n9zADTWvY96htOlaOY2HHGsrQ/zKMf5vqD3nWY924 IEfE9hjAhd9ABQEEk2fSF5XpgOpBtMFcLNMTZelQ9wJcbedCSjbkVcFV0s2iAJOPv9Zo 0ttmTtcJqfp/0z23ZviA4qdWp9PyDwxdYv5EA+D9rtTZhfj5Q+oNt1Yu22Mxx6viPVHm WoKO2IO2sELslZV9QPC4J19WJNh9spyst8W/AcZp29oz//ar5QR5OlayaUXmUgafHY+E UOgGGOjm3pYuicgbwDFLNCxGfJU33IjUurLRWcNq0pz34FKSZZZvSAq9mrl+w7zmLgjk /9iw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=ADW1K4PuhFmDUthAnWNZLxX9smSORrKhgThxl96aaHM=; b=YzMYnqHakXQoZFt+/A5I0nhRGUX9XtYEermMS6Tq7Y1LMUWg+wMHd6LJgq4mXOXDKO t9HB9MF2Zf7HZKw6FCaGEnqzU7ibp2c4pldUJVOWxVfxC6ltFn0XuI7V4TfU4HGjgQLU uMNQmgFfEVi7U6fvGGc1f2EZ+UKRw1VHlZJJvRnXOiZI5syOrZRU11JD+qZAHmR5Ape1 dlMAM0+78nSM2bcjJBpZZYlHYp5Cfji4btgoGTrgDIMT4mCYX7ypHJWd+cMHnNJ5gicb o+0orWiWrUSEkXU4IA4aPiDqeFDZKhGGjRuot7ZrrkxtsHEq2S9DV0IxXJHSt8LGByRA 4qSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=RVQ8BzL8; 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 va28-20020a17090711dc00b007ba16fcfefdsi26765966ejb.936.2023.01.05.11.38.32; Thu, 05 Jan 2023 11:38:46 -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=RVQ8BzL8; 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 S235376AbjAETaR (ORCPT + 55 others); Thu, 5 Jan 2023 14:30:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56940 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235722AbjAET3t (ORCPT ); Thu, 5 Jan 2023 14:29:49 -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 AD056DF0B for ; Thu, 5 Jan 2023 11:23:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1672946574; 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: in-reply-to:in-reply-to:references:references; bh=ADW1K4PuhFmDUthAnWNZLxX9smSORrKhgThxl96aaHM=; b=RVQ8BzL8WFiVfQvdJzNF118wu9XzSD8DtgzNzzMSH6MGeexwSjCVkDwnKEayiA3LurQ45q oP2JUw2dotvO3B2StrvsEJnI+jE9Nt/ED3PXN6kSBJtuGNBlXqwQVSRyQ6QWoqb5I42/Ag 59jJ7dSqxdA+PNlT0AMcCwHkBtFKXF0= Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-310-TQiLpZ97Mz63R68oqcD32Q-1; Thu, 05 Jan 2023 14:22:53 -0500 X-MC-Unique: TQiLpZ97Mz63R68oqcD32Q-1 Received: by mail-qk1-f199.google.com with SMTP id f13-20020a05620a408d00b006fc740f837eso25936617qko.20 for ; Thu, 05 Jan 2023 11:22:53 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=ADW1K4PuhFmDUthAnWNZLxX9smSORrKhgThxl96aaHM=; b=BTUaNHOinhdjIB66SChKf0vUEEZ0GGjBebhzgVnd/yOsfBfoEr4LiueofD7BnpJUBW 5sK4DUUJL373GaPUOIlvzIjJNf0I6tlq17fgDDnQRGhmJ2WcW5ra/aBcPpnp/t2SLt+r sHeef1C4ATLxyJLRsnPdD4bsGBmpAy5WLGcM6+I9ttDug3+C/kpo5Q8+ZH2MI5T8iHTS m0bHT+18HwEyPzST6MaiAC+4Coci8t6zmDTy51eeoJSsNASUNZ53ln2271DpK9WU0Hjx wm5BGixeddlOy+O2vSpMhkpjv4GjNJ2P2bvPn0I9vUiTJqQN5OJ4f4SFJFwr4/H8OyTJ RvOw== X-Gm-Message-State: AFqh2koIl7yCLJE/x9YXDW+E0VNqyAK9vI1t1jPpR4uM79UVI6M6KMaK T3AeebzrHVMJgdbJunofTFUrAUiTnOcSZkefyo6cogWPnSPH0cye9hYps4E/oRS5I+guXklz02R eHrYeAoapcWJi62sKQgpA6yFN X-Received: by 2002:ac8:7c81:0:b0:3a8:11d6:2d0d with SMTP id y1-20020ac87c81000000b003a811d62d0dmr72093652qtv.43.1672946572436; Thu, 05 Jan 2023 11:22:52 -0800 (PST) X-Received: by 2002:ac8:7c81:0:b0:3a8:11d6:2d0d with SMTP id y1-20020ac87c81000000b003a811d62d0dmr72093634qtv.43.1672946572234; Thu, 05 Jan 2023 11:22:52 -0800 (PST) Received: from x1n (bras-base-aurron9127w-grc-39-70-52-228-144.dsl.bell.ca. [70.52.228.144]) by smtp.gmail.com with ESMTPSA id n23-20020ac86757000000b003a826e25bc4sm21893373qtp.64.2023.01.05.11.22.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Jan 2023 11:22:51 -0800 (PST) Date: Thu, 5 Jan 2023 14:22:50 -0500 From: Peter Xu To: David Hildenbrand Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Mike Kravetz , Muchun Song , Nadav Amit , Andrea Arcangeli , James Houghton , Axel Rasmussen , Andrew Morton Subject: Re: [PATCH 2/3] mm/mprotect: Use long for page accountings and retval Message-ID: References: <20230104225207.1066932-1-peterx@redhat.com> <20230104225207.1066932-3-peterx@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: 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,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 Thu, Jan 05, 2023 at 09:44:16AM +0100, David Hildenbrand wrote: > I'm wondering if we should just return the number of changed pages via a > separate pointer and later using an int for returning errors -- when > touching this interface already. > > Only who's actually interested in the number of pages would pass a pointer > to an unsigned long (NUMA). > > And code that expects that there never ever are failures (mprotect, NUMA) > could simply check for WARN_ON_ONCE(ret). > > I assume you evaluated that option as well, what was your conclusion? Since a single long can cover both things as retval, it's better to keep it simple? Thanks, -- Peter Xu