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 X-Spam-Level: X-Spam-Status: No, score=-3.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 449D3C11F66 for ; Tue, 29 Jun 2021 11:59:45 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id C764D61D3A for ; Tue, 29 Jun 2021 11:59:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C764D61D3A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 26CE88D0148; Tue, 29 Jun 2021 07:59:44 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 243FD8D00F0; Tue, 29 Jun 2021 07:59:44 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 10C218D0148; Tue, 29 Jun 2021 07:59:44 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0225.hostedemail.com [216.40.44.225]) by kanga.kvack.org (Postfix) with ESMTP id E1ED88D00F0 for ; Tue, 29 Jun 2021 07:59:43 -0400 (EDT) Received: from smtpin25.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id C4148DDF6 for ; Tue, 29 Jun 2021 11:59:43 +0000 (UTC) X-FDA: 78306617046.25.0AC3387 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf13.hostedemail.com (Postfix) with ESMTP id 48AE3E000253 for ; Tue, 29 Jun 2021 11:59:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=EfGY/OU/KHfnG+UMGD4fPTRavasXM5eyvCC2dckCs1o=; b=gG8b4uQtZu3LtHZvhjVjE6eKeh mb6voMJdBc4w74OLxlAHDfv0I70o3sV1NZts8Y4twxMW+k9P9mCD2EDM/cWlkiqC90vsVPJ669eWj lZgGikNzFyNWYCDEJPn7j5xUYpvHVLl1GoLqY6K+K0gXcf4WyEeXDEgTiszc0GMebP/iQRgVO2Ya6 +Xe8pNph8SF7iQWHYF4FYqeSNgTF2hreghioOP4wLDtEFEfd3H1rD3C247eJ3GKqQHGYj1qdJckj5 OdOw/3L4NLBkpohRg7QvcnEOW2aapPWv/U6EPmzh+ciVaP5dmmZvw2e/+d79gsyJt07UVkB9vrjst TW9OQ+dg==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1lyCO1-00442t-NH; Tue, 29 Jun 2021 11:58:46 +0000 Date: Tue, 29 Jun 2021 12:58:41 +0100 From: Matthew Wilcox To: John Hubbard Cc: Peter Collingbourne , "Kirill A . Shutemov" , Andrew Morton , Catalin Marinas , Evgenii Stepanov , Jann Horn , Linux ARM , linux-mm@kvack.org, kernel test robot , Linux API , linux-doc@vger.kernel.org Subject: Re: [PATCH v4] mm: introduce reference pages Message-ID: References: <20210619092002.1791322-1-pcc@google.com> <51c68f8f-dea1-c0c6-7cfb-28d42338ba88@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <51c68f8f-dea1-c0c6-7cfb-28d42338ba88@nvidia.com> Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=gG8b4uQt; spf=none (imf13.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 48AE3E000253 X-Stat-Signature: jog66cu34xjk4h4weyif3i7zokkb811m X-HE-Tag: 1624967983-900425 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 Tue, Jun 29, 2021 at 12:19:22AM -0700, John Hubbard wrote: > > +SYSCALL_DEFINE2(refpage_create, const void *__user, content, unsigned long, > > + flags) > > From the API discussion (and using a simpler syntax to illustrate this), it > seems like the following would be close: > > enum content_type { > BYTE_PATTERN, > FOUR_BYTE_PATTERN, > ... > FULL_4KB_PAGE > }; > > int refpage_create(const void *__user content, enum content_type, unsigned long flags); > > ...and if content_type == BYTE_PATTERN, then content is a pointer to just one byte of > data, and so forth for the other enum values. That seems a little more complicated and non-extensible. int refpage_create(const void *__user content, unsigned int size, unsigned long flags);