Received: by 10.223.176.46 with SMTP id f43csp1383909wra; Fri, 19 Jan 2018 10:43:15 -0800 (PST) X-Google-Smtp-Source: ACJfBoty4gqcj9Sgkr5uWBgQjVXLG76771buK04Kmm/nUtuBeMc2xXrMFi3+0KA8onIe7dQn7yOF X-Received: by 10.98.178.17 with SMTP id x17mr43477411pfe.57.1516387395729; Fri, 19 Jan 2018 10:43:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516387395; cv=none; d=google.com; s=arc-20160816; b=T7rscWpLByQqMNv1NOOUODv7+TdSIdmpp7W1QTbg2L2ZYqlqg+CFDqbKYsXyRZGqZC cvL/lF7RASdmTeKKjc7AE2Ua+NZ8f11tW1jzbDlDQvai/yrLRBwW1ZRV5Bo+UfPN5iYt iyaAUbbsLtMAbECUljksK9FSyKa7rigUnmruKk1KmyyvP7lax1QKNuxYrNyTxX/ktNPi AawNnL/UaE3o7CT0Pi847fG8KVlKCUET3ue681baMAKyjJJzbeTLQEMeAw+Nqfb8+rzm Uzxar/Cdl1mv0/uzsS/IUOX7XG6xNzmWvIBIIGAjegR5PDiaEnkj04+VDbF2QWxzrQiw oKOw== 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=imOoXFys6vDq81hO1Pma1KYUkUSsZLdFQv27pyysgss=; b=FLDbBKCyPFz0spFOUuAD+BxGCYd6Q+ckDuVqov0Ko8pJ9uY59IA4tvUnwmlCGC2IgJ CtHUm+P5Vi8fCxc9FKksySANkOT+9qs/4nypRn23l8Lze8gpBnFZ3xFYsK45Lx1PLg9V IKDXmcGEYvy54bs2YZXWjBICIGHnD3LjtPMC894dDAxQeOaIsusCmlCCRJ+XbPExDt3+ Ww9yJmmP8d9AgbJSxE4hIT0+AT8ygst1SrIo/VgDRYR3nBKIBsIM560rnL6WuD+I51WT 6bbHIBAmviaJhSXjFwvHGV6ahVtXnqdCeKjK0fC15zUcvPfv9cXYW7i2BdGjNggX8pAq /LsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=NjKZzPMB; 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 g10-v6si1020314plt.206.2018.01.19.10.43.01; Fri, 19 Jan 2018 10:43:15 -0800 (PST) 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=fail header.i=@gmail.com header.s=20161025 header.b=NjKZzPMB; 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 S1756185AbeASSmZ (ORCPT + 99 others); Fri, 19 Jan 2018 13:42:25 -0500 Received: from mail-it0-f54.google.com ([209.85.214.54]:33535 "EHLO mail-it0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755830AbeASSmU (ORCPT ); Fri, 19 Jan 2018 13:42:20 -0500 Received: by mail-it0-f54.google.com with SMTP id c102so5818649itd.0 for ; Fri, 19 Jan 2018 10:42:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=imOoXFys6vDq81hO1Pma1KYUkUSsZLdFQv27pyysgss=; b=NjKZzPMBnAPvYzLR3/0rgee0DA2cd7COH2ICcXxdPJfJHSS3KrvzGoxu1q6G5rrIPT y5Rt9p5ok/ZlfbnoPxNUcoHNdmnWCp9rOxzBHDzgOR1W7HTSXuZIyxGwKPV8aaiXEkMz 1zpu6VfHQqZ5Z9BEoBFubokJj/e2kbHOdmb2/MXFgPu5WBbxHsDTw3fOljqEK60OXfo4 HoVJjd5np2yoybnOUiPBHTr2dohjUYMVpsDhoKsR7uodzbpdBfbkvCo+BiNnORtcA5Fh framW6XGJnmgnaENB8HA5ZUwqyHhItXFkpw7Tj6K+RAMXD/N1ZwmLGHs0Ir+xYBVSjMy PE7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=imOoXFys6vDq81hO1Pma1KYUkUSsZLdFQv27pyysgss=; b=D5wTxZHb9meBgzHPBIM1zBTV1Gv4i8f26bSdMalBYSY18mdxobnF7UaOiLqU9lmrXf 44qDNhKWlp6HlDriuwVeLGFbdtWesBSg15DQKbGOlNdqYI+da2p3TzTKUki5cjetwPZR 9HiYkHI+g1S9h6MXrv2tE4OZd1nxLeELfq+1vva8DcQkjm0jFBlKC+0/P4Vo16UbiF+q mSoTPayKGaI/WqynUsTrHbEHP7KBa/gZSKOefN4yVnzoxVxxukS1wv/Zm+/AzxvMJFSq /uzafCm0zlN78bke2vHIVIU5MDJGjBEtu1YTtuu+1sazKXSco/+sVv1NTPlawni/e1wR 2pEQ== X-Gm-Message-State: AKwxytfHaGxRe4ot6xzHoIdDqzt3oivWKyD6OEbzHcqS3JS2wVFFHvf4 u4i8CTn6WruX7K8CPwahCXAqFV2oZUo36O9Egqs= X-Received: by 10.36.47.5 with SMTP id j5mr24588871itj.123.1516387339283; Fri, 19 Jan 2018 10:42:19 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.59.196 with HTTP; Fri, 19 Jan 2018 10:42:18 -0800 (PST) In-Reply-To: <20180119125503.GA2897@bombadil.infradead.org> References: <201801170233.JDG21842.OFOJMQSHtOFFLV@I-love.SAKURA.ne.jp> <201801172008.CHH39543.FFtMHOOVSQJLFO@I-love.SAKURA.ne.jp> <201801181712.BFD13039.LtHOSVMFJQFOFO@I-love.SAKURA.ne.jp> <20180118122550.2lhsjx7hg5drcjo4@node.shutemov.name> <20180118145830.GA6406@redhat.com> <20180118165629.kpdkezarsf4qymnw@node.shutemov.name> <20180118234955.nlo55rw2qsfnavfm@node.shutemov.name> <20180119125503.GA2897@bombadil.infradead.org> From: Linus Torvalds Date: Fri, 19 Jan 2018 10:42:18 -0800 X-Google-Sender-Auth: OkV6WeKovJO8Ty_o33uxjb2mvds Message-ID: Subject: Re: [mm 4.15-rc8] Random oopses under memory pressure. To: Matthew Wilcox Cc: "Kirill A. Shutemov" , Peter Zijlstra , Andrea Arcangeli , Dave Hansen , Tetsuo Handa , "Kirill A. Shutemov" , Andrew Morton , Johannes Weiner , Joonsoo Kim , Mel Gorman , Tony Luck , Vlastimil Babka , Michal Hocko , "hillf.zj" , Hugh Dickins , Oleg Nesterov , Rik van Riel , Srikar Dronamraju , Vladimir Davydov , Ingo Molnar , Linux Kernel Mailing List , linux-mm , "the arch/x86 maintainers" 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 Fri, Jan 19, 2018 at 4:55 AM, Matthew Wilcox wrote: > > So really we should be casting 'b' and 'a' to uintptr_t to be fully > compliant with the spec. That's an unnecessary technicality. Any compiler that doesn't get pointer inequality testing right is not worth even worrying about. We wouldn't want to use such a compiler, because it's intentionally generating garbage just to f*ck with us. Why would you go along with that? So the only real issue is that pointer subtraction case. I actually asked (long long ago) for an optinal compiler warning for "pointer subtraction with non-power-of-2 sizes". Not because of it being undefined, but simply because it's expensive. The divide->multiply thing doesn't always work, and a real divide is really quite expensive on many architectures. We *should* be careful about it. I guess sparse could be made to warn, but I'm afraid that we have so many of these things that a warning isn't reasonable. And most of the time, a pointer difference really is inside the same array. The operation doesn't tend to make sense otherwise. Linus