Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp4498079ybi; Tue, 11 Jun 2019 07:37:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqwAMHiFZuvwlsKx0PLao15tVn/lxNyPROsnzRLB19SAF/fzrgzzhwNsoF/q96HxbPx4EF7C X-Received: by 2002:a17:902:2e81:: with SMTP id r1mr76684880plb.0.1560263866251; Tue, 11 Jun 2019 07:37:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560263866; cv=none; d=google.com; s=arc-20160816; b=LN7fisp40sogCembwDNYA0eQYyJy7+uE1JFZjlXjZWArnyAAiD0R0BY8BIzb0TgeR4 k2b3VavBGoN2Uo21PEb6LNJIIwyBX524/H9W4ZMuc4AAhWh6pHbCt3FId29Y7rQjymug QZVgIejgHynQIxA73pc6lo05Ja1aHO/Lll0/W6875/475oQXU5MuWOIwYG47e/ec4q5f Y4b+QF3v0aq5LlhsKT/NUSbUu6gKT2hyENDDCfEu4D7R8CeRene8Jr74USt3TerizT4I tjAp2jN3ciV9XYgp54R+lqnVV9Ie+cBPjxMU8rdVCriTbb2koCQjHySoyKmBZQSQ49H7 FrEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=R4/9INRI6KTX6FdVgwat0kPEuSKF7xIu6Kle38300yQ=; b=ZtNqDi7Jr834uuuJx/HQzEhZh4ArWjQLQQTRJzq1OUXAYHAA8f75JrTykZGqv3Ft1Y zZpPvUDSVBJrH/bvoytQB8+ndRTpHG4++4ov++KPZMRtfPbXCm7mN5/U4wAVCZzmh0DA hk4M6AbiykvsRGiVjOkJ5sR33aBAoyft0Dyk4kwwMDKOAznlzd+X+x7uqXF4h7mz82H3 LXSkAtRStB532v8XBE88dkon9jM8pYNGSx0Cfaqb3oprb208TJ36wJ4Frt7y2287oLC8 Vbp6Adc0BHisj4Jd5BiULU8o0ir/phYQNAKFhD48/Hpx5+Rx53y6jgqvFJD8xEPtiTCE w/Ow== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w7si12226200pgr.399.2019.06.11.07.37.30; Tue, 11 Jun 2019 07:37:46 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390386AbfFKOg5 (ORCPT + 99 others); Tue, 11 Jun 2019 10:36:57 -0400 Received: from foss.arm.com ([217.140.110.172]:34522 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387551AbfFKOg5 (ORCPT ); Tue, 11 Jun 2019 10:36:57 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 093FC346; Tue, 11 Jun 2019 07:36:56 -0700 (PDT) Received: from [10.1.29.141] (e121487-lin.cambridge.arm.com [10.1.29.141]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 187C33F557; Tue, 11 Jun 2019 07:36:54 -0700 (PDT) Subject: Re: [PATCH 02/17] mm: stub out all of swapops.h for !CONFIG_MMU To: Christoph Hellwig Cc: Palmer Dabbelt , Damien Le Moal , linux-riscv@lists.infradead.org, uclinux-dev@uclinux.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <20190610221621.10938-1-hch@lst.de> <20190610221621.10938-3-hch@lst.de> <516c8def-22db-027c-873d-a943454e33af@arm.com> <20190611141841.GA29151@lst.de> From: Vladimir Murzin Message-ID: <80d01a1d-b6b0-18e8-811c-71af14cba3b9@arm.com> Date: Tue, 11 Jun 2019 15:36:53 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: <20190611141841.GA29151@lst.de> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/11/19 3:18 PM, Christoph Hellwig wrote: > On Tue, Jun 11, 2019 at 11:15:44AM +0100, Vladimir Murzin wrote: >> On 6/10/19 11:16 PM, Christoph Hellwig wrote: >>> The whole header file deals with swap entries and PTEs, none of which >>> can exist for nommu builds. >> >> Although I agree with the patch, I'm wondering how you get into it? > > Without that the RISC-V nommu blows up like this: > > > In file included from mm/vmscan.c:58: > ./include/linux/swapops.h: In function ‘pte_to_swp_entry’: > ./include/linux/swapops.h:71:15: error: implicit declaration of function ‘__pte_to_swp_entry’; did you mean ‘pte_to_swp_entry’? [-Werror=implicit-function-declaration] > arch_entry = __pte_to_swp_entry(pte); > ^~~~~~~~~~~~~~~~~~ > pte_to_swp_entry > ./include/linux/swapops.h:71:13: error: incompatible types when assigning to type ‘swp_entry_t’ {aka ‘struct ’} from type ‘int’ > arch_entry = __pte_to_swp_entry(pte); > ^ > ./include/linux/swapops.h:72:19: error: implicit declaration of function ‘__swp_type’; did you mean ‘swp_type’? [-Werror=implicit-function-declaration] > return swp_entry(__swp_type(arch_entry), __swp_offset(arch_entry)); > ^~~~~~~~~~ > swp_type > ./include/linux/swapops.h:72:43: error: implicit declaration of function ‘__swp_offset’; did you mean ‘swp_offset’? [-Werror=implicit-function-declaration] > return swp_entry(__swp_type(arch_entry), __swp_offset(arch_entry)); > ^~~~~~~~~~~~ > swp_offset > ./include/linux/swapops.h: In function ‘swp_entry_to_pte’: > ./include/linux/swapops.h:83:15: error: implicit declaration of function ‘__swp_entry’; did you mean ‘swp_entry’? [-Werror=implicit-function-declaration] > arch_entry = __swp_entry(swp_type(entry), swp_offset(entry)); > ^~~~~~~~~~~ > swp_entry > ./include/linux/swapops.h:83:13: error: incompatible types when assigning to type ‘swp_entry_t’ {aka ‘struct ’} from type ‘int’ > arch_entry = __swp_entry(swp_type(entry), swp_offset(entry)); > ^ > ./include/linux/swapops.h:84:9: error: implicit declaration of function ‘__swp_entry_to_pte’; did you mean ‘swp_entry_to_pte’? [-Werror=implicit-function-declaration] > return __swp_entry_to_pte(arch_entry); > ^~~~~~~~~~~~~~~~~~ > swp_entry_to_pte > ./include/linux/swapops.h:84:9: error: incompatible types when returning type ‘int’ but ‘pte_t’ {aka ‘struct ’} was expected > return __swp_entry_to_pte(arch_entry); > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > cc1: some warnings being treated as errors > make[1]: *** [scripts/Makefile.build:278: mm/vmscan.o] Error 1 > make: *** [Makefile:1071: mm] Error 2 > make: *** Waiting for unfinished jobs.... > It looks like NOMMU ports tend to define those. For ARM they are: #define __swp_type(x) (0) #define __swp_offset(x) (0) #define __swp_entry(typ,off) ((swp_entry_t) { ((typ) | ((off) << 7)) }) #define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) }) #define __swp_entry_to_pte(x) ((pte_t) { (x).val }) Anyway, I have no strong opinion on which is better :) Cheers Vladimir