Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1743699imm; Sat, 2 Jun 2018 07:56:39 -0700 (PDT) X-Google-Smtp-Source: ADUXVKI1hHOZFO/0ihnaoAlwuaET2vddiF4IuH5zH2qr25p8Rz3ExpNJHSotKXt5yyTUgH3vZqss X-Received: by 2002:a62:1bc2:: with SMTP id b185-v6mr11384858pfb.225.1527951399139; Sat, 02 Jun 2018 07:56:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527951399; cv=none; d=google.com; s=arc-20160816; b=J/KmfGb7dOfGLgQyho3oqcgSLVo4wM6omcDtJa6jqyiGRu7mfazB7gyGfM8QDsZqVc UJcq05ZQZlsQolW+4Rvzl6k+1U0ZJc2jODT9GwhbkV5+dpjQlhOJtBkvsK4DRoEZvmH5 ylWzeWV6JUC3UWVP7PFA/K0HBESwBmUOzbg+q2IZJnAqf1krJaT+kHXRrrC/XC0atU7p XOIVHtbQ7pCFyP1N04fWRFUsQNzBpj6zxBw8PjVFjIoxOY7lDh4iD2wmcQphbD7Sc8pY INUTtuEvjX3VrxY6X26P/j03QCcOPQ0oaqN7DsfQ9ielAkK2/Xu/29cY3mrIgwEMdkvg gFzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=epJOc0tUk18dHKwHOGoDQyiM2UKVHDmpVGc6LkxNtns=; b=0pPT+RSrAa53MLAdZbMVQlVHULtsePOFfmTGY7LZKgrImk1wLwSjdyH99/K7kxKp1f GfCSyB3rBpxzcSKT6Jtvr2Bxx64K5e91b8VaHrTQGTdO5sV6QkjTbrzXSF8Q1lG7tlGz AM9YHS3D1wGPtYczhE3F5/l22l9hvuLvqqGDs/IY8pUtKSK1j0cqt0aJufonj9J3Q6ig oISdHoI+d0Y4kv/H+ksmcff6ue0YYePaELIW8NRxw6Ig6HK2mnjh07u2gODB0mT21D82 SGXd3fKnsdGgcQJOkLFCjtiqqCYfy/S1fIEYt4UI0io9OC7O6vp82t+2AqRGIp63tGCU bejQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=g8lDx/om; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bb5-v6si40381337plb.80.2018.06.02.07.56.10; Sat, 02 Jun 2018 07:56:39 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=g8lDx/om; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750964AbeFBOze (ORCPT + 99 others); Sat, 2 Jun 2018 10:55:34 -0400 Received: from mail-lf0-f66.google.com ([209.85.215.66]:44065 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750740AbeFBOzc (ORCPT ); Sat, 2 Jun 2018 10:55:32 -0400 Received: by mail-lf0-f66.google.com with SMTP id 36-v6so16976396lfr.11; Sat, 02 Jun 2018 07:55:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=epJOc0tUk18dHKwHOGoDQyiM2UKVHDmpVGc6LkxNtns=; b=g8lDx/omb6HsNdfJtiq002FMVwd9mi9TrRwqwSahtGFgdHwf8JPuJT9QFNmkbIOAQc GvzKr/dpy8PhKGirmiboheN9QeHFPZ/jUluA5nErPLFXbCrgFxwVA9H7KxlG5ETLPoyM YUydZDUQ/QuUfzTjG+YhNrdARnObN6dMqKrAo2OQIkcwCbIgZmJOecJTLO13lqrY2OI6 9wtb5AH28rhTF+n/nsA/615jWGhigltKDxTM7NsHsVsAERRiNm+lGRklzYQRBuwUwQMl 5FrwTzjyJbDC32leaZykw5cH2B2Ohcdq9NQvwmiFWvufo821lyIZowK9GC7AKThCwMxx TeKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=epJOc0tUk18dHKwHOGoDQyiM2UKVHDmpVGc6LkxNtns=; b=tn72QDFZEVCtAvvN80Fs352i91owBOLqrkjfguJKi1rTPa3844PIA9H5SP1qz7fciX NtRoVmHGVCP9ot7fdzQV+9PDPbLDvTizMo003cKcNzihdViG9AiqrbrCi+kDbXwgfLJx YlqyIrajhvm6J9mJOKguAypUjM0WVQryt7svc9zKt3YvhsCbdg1veSkb0KVkEKkF9qSj M/fql8DOV667dNas9SMU8ojXLIrySZveBfhGJDNOQtoFvMQGs403tLRaBsSmOR9QYVDY WgJ2suUOxiQOoVUaitm+VJwTMW3CoD9s+T/xwYWwHFvyV+MkEg1v+r899X9q3MmGuyCK eLFA== X-Gm-Message-State: ALKqPwdmAZQV7qk+rWxn80lAZjMng/d5G1MXUrrodj3eV/BVb2NtIgCp qfsB9XuhSCikyTmAfI6fiElmwzYBV4655ksXhEk= X-Received: by 2002:a2e:934f:: with SMTP id m15-v6mr7622361ljh.39.1527951330347; Sat, 02 Jun 2018 07:55:30 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a19:d885:0:0:0:0:0 with HTTP; Sat, 2 Jun 2018 07:55:29 -0700 (PDT) In-Reply-To: <20180530111602.GB17450@bombadil.infradead.org> References: <20180529143126.GA19698@jordon-HP-15-Notebook-PC> <20180529145055.GA15148@bombadil.infradead.org> <20180529173445.GD15148@bombadil.infradead.org> <20180530111602.GB17450@bombadil.infradead.org> From: Souptick Joarder Date: Sat, 2 Jun 2018 20:25:29 +0530 Message-ID: Subject: Re: [PATCH] mm: Change return type to vm_fault_t To: Matthew Wilcox Cc: Al Viro , Hugh Dickins , Andrew Morton , Michal Hocko , Ross Zwisler , zi.yan@cs.rutgers.edu, "Kirill A. Shutemov" , Dan Williams , Greg KH , Mark Rutland , riel@redhat.com, pasha.tatashin@oracle.com, jschoenh@amazon.de, Kate Stewart , David Rientjes , tglx@linutronix.de, Peter Zijlstra , Mel Gorman , yang.s@alibaba-inc.com, Minchan Kim , linux-fsdevel , linux-kernel@vger.kernel.org, Linux-MM Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 30, 2018 at 4:46 PM, Matthew Wilcox wrote: > On Wed, May 30, 2018 at 09:10:47AM +0530, Souptick Joarder wrote: >> On Tue, May 29, 2018 at 11:04 PM, Matthew Wilcox wrote: >> > I see: >> > >> > mm/gup.c:817:15: warning: invalid assignment: |= >> > mm/gup.c:817:15: left side has type int >> > mm/gup.c:817:15: right side has type restricted vm_fault_t >> > >> > are you building with 'c=2' or 'C=2'? >> >> Building with C=2. >> Do I need to enable any separate FLAG ? > > Nope. Here's what I have: > > willy@bobo:~/kernel/souptick$ make C=2 mm/gup.o > CHK include/config/kernel.release > CHK include/generated/uapi/linux/version.h > CHK include/generated/utsrelease.h > CHECK arch/x86/purgatory/purgatory.c > CHECK arch/x86/purgatory/sha256.c > CHECK arch/x86/purgatory/string.c > arch/x86/purgatory/../boot/string.c:134:6: warning: symbol 'simple_strtol' was not declared. Should it be static? > CHK include/generated/bounds.h > CHK include/generated/timeconst.h > CHK include/generated/asm-offsets.h > CALL scripts/checksyscalls.sh > DESCEND objtool > CHECK scripts/mod/empty.c > CHK scripts/mod/devicetable-offsets.h > CHECK mm/gup.c > mm/gup.c:817:15: warning: invalid assignment: |= > mm/gup.c:817:15: left side has type int > mm/gup.c:817:15: right side has type restricted vm_fault_t > CC mm/gup.o > Matthew, Due to some unidentified error still not able to catch this warning in (X86_64 + sparse) compilation. It is constantly showing below error. Documents/linux-4.17-rc7$ make C=2 -j4 mm/gup.o CHK include/config/kernel.release CHK include/generated/uapi/linux/version.h DESCEND objtool CHK include/generated/utsrelease.h CHECK scripts/mod/empty.c CHK scripts/mod/devicetable-offsets.h CHK include/generated/bounds.h CHK include/generated/timeconst.h CHK include/generated/asm-offsets.h CALL scripts/checksyscalls.sh CHECK mm/gup.c mm/gup.c:394:17: error: undefined identifier '__COUNTER__' mm/gup.c:439:9: error: undefined identifier '__COUNTER__' mm/gup.c:441:9: error: undefined identifier '__COUNTER__' mm/gup.c:443:9: error: undefined identifier '__COUNTER__' mm/gup.c:508:17: error: undefined identifier '__COUNTER__' mm/gup.c:716:25: error: undefined identifier '__COUNTER__' mm/gup.c:826:17: error: undefined identifier '__COUNTER__' mm/gup.c:863:17: error: undefined identifier '__COUNTER__' mm/gup.c:865:17: error: undefined identifier '__COUNTER__' mm/gup.c:882:25: error: undefined identifier '__COUNTER__' mm/gup.c:883:25: error: undefined identifier '__COUNTER__' mm/gup.c:920:25: error: undefined identifier '__COUNTER__' ./include/linux/hugetlb.h:239:9: error: undefined identifier '__COUNTER__' But able to capture it in (powerpc + sparse) compilation. I will fix it in v2. /Documents/linux-4.17-rc7$ make C=2 ARCH=powerpc CROSS_COMPILE=powerpc-linux-gnu- mm/gup.o CHK include/config/kernel.release CHK include/generated/uapi/linux/version.h CHK include/generated/utsrelease.h CHK include/generated/bounds.h CHK include/generated/timeconst.h CHK include/generated/asm-offsets.h CALL scripts/checksyscalls.sh CHECK scripts/mod/empty.c CHK scripts/mod/devicetable-offsets.h CHECK mm/gup.c ./arch/powerpc/include/asm/book3s/64/pgtable.h:669:24: warning: restricted __be64 degrades to integer mm/gup.c:820:15: warning: incorrect type in assignment (different base types) mm/gup.c:820:15: expected int [signed] major mm/gup.c:820:15: got restricted vm_fault_t mm/gup.c:1247:24: warning: expression using sizeof bool mm/gup.c:1247:24: warning: expression using sizeof(void) mm/gup.c:1247:24: warning: expression using sizeof(void) ./arch/powerpc/include/asm/book3s/64/pgtable.h:667:20: warning: incorrect type in initializer (different base types) ./arch/powerpc/include/asm/book3s/64/pgtable.h:667:20: expected unsigned long long [unsigned] [usertype] mask ./arch/powerpc/include/asm/book3s/64/pgtable.h:667:20: got restricted __be64 [usertype] mm/gup.c:1735:6: warning: symbol 'gup_fast_permitted' was not declared. Should it be static? CC mm/gup.o Also Sparse is throwing below warning -> /Documents/linux-4.17-rc7$ make C=2 ARCH=powerpc CROSS_COMPILE=powerpc-linux-gnu- mm/hugetlb.o CHK include/config/kernel.release CHK include/generated/uapi/linux/version.h CHK include/generated/utsrelease.h CHK include/generated/bounds.h CHK include/generated/timeconst.h CHK include/generated/asm-offsets.h CALL scripts/checksyscalls.sh CHECK scripts/mod/empty.c CHK scripts/mod/devicetable-offsets.h CHECK mm/hugetlb.c mm/hugetlb.c:3778:33: warning: restricted vm_fault_t degrades to integer mm/hugetlb.c:3777:31: warning: restricted vm_fault_t degrades to integer mm/hugetlb.c:3777:29: warning: incorrect type in assignment (different base types) mm/hugetlb.c:3777:29: expected restricted vm_fault_t [assigned] [usertype] ret mm/hugetlb.c:3777:29: got unsigned int mm/hugetlb.c:3895:33: warning: restricted vm_fault_t degrades to integer mm/hugetlb.c:3894:32: warning: restricted vm_fault_t degrades to integer mm/hugetlb.c:3894:56: warning: incorrect type in return expression (different base types) mm/hugetlb.c:3894:56: expected restricted vm_fault_t mm/hugetlb.c:3894:56: got unsigned int Which is fixed by -> "#define VM_FAULT_SET_HINDEX(x) ((__force vm_fault_t)((x) << 16))" in final vm_fault_t patch. Does it looks good ?