Received: by 10.223.176.46 with SMTP id f43csp3315128wra; Mon, 22 Jan 2018 12:00:23 -0800 (PST) X-Google-Smtp-Source: AH8x227T+/jJhkf4nd9s0okt+y7VW1/Q6O+QxWfyqJoVBmn+yTrtqTiPv595Ma0WU9un7k7M++PC X-Received: by 10.107.141.147 with SMTP id p141mr32520iod.79.1516651222971; Mon, 22 Jan 2018 12:00:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516651222; cv=none; d=google.com; s=arc-20160816; b=drqkY8h8DLelqnph7iM0NUDZZqU8H15aByURd1B0ZUTmDFvQajBSwLaf6GEyBnvOvo /qkILbpzPVlk2J+2K/817Jcgu97qStgGwZ84Rw7dcpjEexfR8Vs8PytQB5q1oFa+zrqJ z1TiqcwjsNpzXPJE8nSHOi6UgOk/AZN4/NpUKk2oSLlWwx4w2ABH0jcGid34jdLzII26 5nbNX7tG8H6FVkDLI4sh+ewRnCUCi00TtFKLPD8wBMhwXgaZ3sQNmebzP9XTmsyxWxt9 daOTGySPcXxVbg1ojzUo092BhVdjJyM0VsXWw87JAkyH15Uzuv/Wx2uYPEhlOWFshNxw aIvw== 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=/luDr6D1G7S07HjFMWt6RJoocYxqNmIfqyWB+CoQVJg=; b=vKSCcI9qOEYJXZ5pfUWdo8jQMnoQmhTgq7Xg6wADfveK0okUvmgmkd/cISySr0vP29 3MhSL2I4MshbS1ld5XtqTYQ4p+CkEETR7SUUKCbyrQINCYhtXcQabtgN47FZpXro3RbD Gi3sTfPy7KCwdy/mm/g4+OGq+ug7AT3deytNffrVmCTCsAufw8zNk0vX1c7eN5TQrEh+ yvN4009IspYXIMUp8QmWjPjjfL2wmPnGB+ehCMdVZHFXJnMp7SiGIXthuIxR9NyifrQJ kHQMLSqy+OWtVbOCfgCJ3GB/QZZcnxvMpaq4NuOPnnmf3VbPtjPDl114H+XeO/y71u4R kRPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=ptMwwiHV; 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 d8si6443346itf.75.2018.01.22.12.00.09; Mon, 22 Jan 2018 12:00:22 -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=ptMwwiHV; 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 S1751199AbeAVT6d (ORCPT + 99 others); Mon, 22 Jan 2018 14:58:33 -0500 Received: from mail-io0-f194.google.com ([209.85.223.194]:39048 "EHLO mail-io0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750891AbeAVT6L (ORCPT ); Mon, 22 Jan 2018 14:58:11 -0500 Received: by mail-io0-f194.google.com with SMTP id b198so10715181iof.6 for ; Mon, 22 Jan 2018 11:58:11 -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=/luDr6D1G7S07HjFMWt6RJoocYxqNmIfqyWB+CoQVJg=; b=ptMwwiHV5fUTXbJo0M4REt6v7XBd2LsaqrUM27xCVFzIIEj0UL70efaIBuKLr3+h2N KWbPbZtoyH0uczN7lM1gsRjajtJdbsy0NQMijfNPtY5t82Xepevr+R6dx71Ne1S1Bo90 RERUumjzX79zphKTkG+3F3h4pEjd/Ntk6SlKZZE5XpgJyFXGulqZU3IqWzCw3n/sIBHt FTEusSEUk2waLdJbcKldIXs7CbbVxBVCb6Pk4U9sVIIS0Xocl7KawOV/miTjbF6iYi2g 8vAUehJqkfwxy4Jv40JgcIBMVu5QgUgo6BDnJMTgPFHyqAbxKVYYZlNW9kn73wMhEi3h MmCA== 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=/luDr6D1G7S07HjFMWt6RJoocYxqNmIfqyWB+CoQVJg=; b=hQ5j/oqb+EbUqfB0DhD4OwKUm1H7OOVx8hLUm3pzNr2/Z5Ftcs7Mf6DEjQo2eap358 z1dqkNCKAK0RFJ+lGjrlGbiBNvZzLS6EhgqqBQN78H1JkvSsNcmF9exC5NpRol8ANg/Y s0iXBOUCQoWjQQuVDuNFj2jIz1rgEEy89W/DXv3luWHKlu6TT6rdCUfrjt0ZkiMqpnvM Uj90gMcPfdS8ma/aNXGMZYXrodaX86PQ1GMlvbRQQyeXU+P2hwCvQ6RDVOFfh1MX+aBB iWTPhlX+JTsvrq62cRaWcH62bXj4Zxh1Tt+Y10ZZ2EwKA+R743XSDeEhqBBFwKwjrIaj YKhg== X-Gm-Message-State: AKwxytfr/w98M1gNZE5QeA2nDBE3p0TD8w2zWE1DYuv8scQLiyfh01aC uCl8HpKlXry8D4m6rIdM9F+nDa8FbgxsQtj5Yks= X-Received: by 10.107.132.3 with SMTP id g3mr71038iod.46.1516651090407; Mon, 22 Jan 2018 11:58:10 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.59.196 with HTTP; Mon, 22 Jan 2018 11:58:09 -0800 (PST) In-Reply-To: <6f0abb8d-84b3-070e-fca7-c71524311702@prevas.dk> 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> <6f0abb8d-84b3-070e-fca7-c71524311702@prevas.dk> From: Linus Torvalds Date: Mon, 22 Jan 2018 11:58:09 -0800 X-Google-Sender-Auth: kyS4RDvKtJXD1yXBPN8v5_zb1Xg Message-ID: Subject: Re: [mm 4.15-rc8] Random oopses under memory pressure. To: Rasmus Villemoes Cc: "Kirill A. Shutemov" , Matthew Wilcox , Al Viro , Linux Kernel Mailing List 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 Mon, Jan 22, 2018 at 5:26 AM, Rasmus Villemoes wrote: > On 2018-01-19 19:42, Linus Torvalds wrote: >> >> 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, > > Huh? If (compile-time constant, positive) d=m*2^k with m odd, and x is > known to be a multiple of d, x/d can always be computed as (x>>k)*m' == > (x*m')>>k, with m' being the mod 2^N multiplicative inverse of m, right? Hmm. I have definitely seen gcc generate the difference with a divide. But it may be less of a "can't do it with a multiply" and more of a "not all versions of gcc have the multiplication optimization". Linus