Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 5F8E6200C36 for ; Fri, 24 Feb 2017 01:48:24 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 5E3AD160B67; Fri, 24 Feb 2017 00:48:24 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id A1266160B64 for ; Fri, 24 Feb 2017 01:48:23 +0100 (CET) Received: (qmail 94600 invoked by uid 500); 24 Feb 2017 00:48:22 -0000 Mailing-List: contact dev-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list dev@httpd.apache.org Received: (qmail 94590 invoked by uid 99); 24 Feb 2017 00:48:22 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 24 Feb 2017 00:48:22 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 2A59A18E837 for ; Fri, 24 Feb 2017 00:48:22 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.321 X-Spam-Level: X-Spam-Status: No, score=-0.321 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_SORBS_SPAM=0.5, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id wG0YLkS1iVIe for ; Fri, 24 Feb 2017 00:48:21 +0000 (UTC) Received: from mail-qt0-f172.google.com (mail-qt0-f172.google.com [209.85.216.172]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 5E0155F30C for ; Fri, 24 Feb 2017 00:48:20 +0000 (UTC) Received: by mail-qt0-f172.google.com with SMTP id r45so6349670qte.3 for ; Thu, 23 Feb 2017 16:48:20 -0800 (PST) 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; bh=HhmQ9hpZjyFvZz9QO7fOJpVxu3u4gA3wwj0S8auyCyg=; b=B7ftKTMY1tx7jxPD5AqnbZ/1a6DZKWmfxpwIrH/zIHkjaaFyhmSFzcF0PPc7FU34SG Dpfdm1c9qDTV32kbz/x1fOvY2RuL3vF3op1Tts0His5rV0qRy//t7FgN9p+qiNo6tbHQ oI00C4M2mbKjLPs4qDa9FxFBDeRPhL3Bjd7VxMwkv6MLoRyaZM03QAwgblsfxwiqoB// egqoMNsub22ukRzDmHs/jYbFA4ub0OAPgk2BNmp61QtIGfK8VOQnYr5jdMf1z+Xw9Gp2 IPaVtNqZcjwFM9O/juGNeJoVnjYCFYQaPHqv7HuGuXJQpKZXq6eqwPn9hBbaSrrO2SkJ uCrQ== 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; bh=HhmQ9hpZjyFvZz9QO7fOJpVxu3u4gA3wwj0S8auyCyg=; b=gkCVTVJ0KDLY1w3JI+jV41QVBH2UxDXfuIXmePz0J40tgGJGEgIiQjvISBXWsfppj0 5gsmcZljOufhCqBE97lylCTu7AVCrpNCbbvr7wwQAWwPwuwZfGjuX874xXL+krpsvTrQ a05vgFvAESIm7hBnWxttmyeIfQuit+i9/GkoA2vK3UbmVQv6RsN8B9cQScl0wjRLfxuT XUNd57/RWK6AgfAuSY5zm0GufDkEVW+sHNBLg7rsj1jBobsAmv8Sq2jevFzCrWAWpAqc YFnYYKWA3juMuTPcNtELVeG8/rLQhWymcXWPF+Y+dl1LilZKBqFG+XcvE9XBAyVrwJed 8rQg== X-Gm-Message-State: AMke39nXyR7neMPn/yJi8z5uoc4jlwFQeLwt0RG0dQtZy/HtO4XILwUUBYN5ul9KqFZlxu41E91knlX7B2uAtw== X-Received: by 10.237.33.209 with SMTP id m17mr41546212qtc.59.1487897295290; Thu, 23 Feb 2017 16:48:15 -0800 (PST) MIME-Version: 1.0 Received: by 10.55.155.131 with HTTP; Thu, 23 Feb 2017 16:48:14 -0800 (PST) In-Reply-To: References: <2B733D2A-F05D-4857-9434-721A9AE78CF8@greenbytes.de> <30d3bd5d-48cf-770f-53c8-b4ec279da2bd@gmail.com> <712ee78b-179f-1381-7aec-ad9d9ccb9334@gmail.com> <2450d64e-cfed-08b9-c995-4a5937753511@gmail.com> <9DF9D902-5357-496E-A597-DB5130D50E06@greenbytes.de> From: Yann Ylavic Date: Fri, 24 Feb 2017 01:48:14 +0100 Message-ID: Subject: Re: httpd 2.4.25, mpm_event, ssl: segfaults To: httpd-dev Content-Type: text/plain; charset=UTF-8 archived-at: Fri, 24 Feb 2017 00:48:24 -0000 On Thu, Feb 23, 2017 at 10:06 PM, Daniel Lescohier wrote: > Why would high-order memory allocations be a problem in userspace code, > which is using virtual memory? I thought high-order allocations is a big > problem in kernel space, which has to deal with physical pages. Well, both in kernel or user space, the difficulty is finding large contiguous memory. With virtual memory (admittedly virtually larger than physical memory), it needs more "active" regions to fail, but still it can fail if many heterogeneous chunks are to be mapped at a time, the OOM killer will do its job. It depends on how closed to the resident memory limit you are of course (it won't happen if some memory can be compressed or swapped), but large chunks are no better with lot of RAM either. > > But when you write to a socket, doesn't the kernel scatter the userspace > buffer into multiple SKBs? SKBs on order-0 pages allocated by the kernel? Right, in Linux network stack (or drivers) is mainly using (or is moving to) order 0 or 1 chunks (with scatterlists when needed). But this is where httpd's job end, we talk about before this here :) From the other message: On Wed, Feb 22, 2017 at 8:55 PM, Daniel Lescohier wrote: > > IOW: > read():Three copies: copy from filesystem cache to httpd read() buffer to > encrypted-data buffer to kernel socket buffer. Not really, "copy from filesystem cache to httpd read() buffer" is likely mapping to userspace, so no copy (on read) here. > mmap(): Two copies: filesystem page already mapped into httpd, so just copy > from filesystem (cached) page to encrypted-data buffer to kernel socket > buffer. So, as you said earlier the "write to socket" isn't a copy either, hence both read() and mmap() implementations could work with a single copy when mod_ssl is involved (this is more than a copy but you counted it above so), and no copy at all without it. Regards, Yann.