From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=0.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,SUBJECT_NEEDS_ENCODING, SUBJ_ILLEGAL_CHARS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4C531C433DF for ; Fri, 19 Jun 2020 07:14:48 +0000 (UTC) Received: from shelob.surriel.com (shelob.surriel.com [96.67.55.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 176EC2078D for ; Fri, 19 Jun 2020 07:14:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 176EC2078D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=vt.edu Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kernelnewbies-bounces@kernelnewbies.org Received: from localhost ([::1] helo=shelob.surriel.com) by shelob.surriel.com with esmtp (Exim 4.94) (envelope-from ) id 1jmBE6-0000S2-Ra; Fri, 19 Jun 2020 03:14:14 -0400 Received: from omr1.cc.ipv6.vt.edu ([2607:b400:92:8300:0:c6:2117:b0e] helo=omr1.cc.vt.edu) by shelob.surriel.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94) (envelope-from ) id 1jmBE4-0000Rw-Dp for Kernelnewbies@kernelnewbies.org; Fri, 19 Jun 2020 03:14:12 -0400 Received: from mr1.cc.vt.edu (mail.ipv6.vt.edu [IPv6:2607:b400:92:9:0:9d:8fcb:4116]) by omr1.cc.vt.edu (8.14.4/8.14.4) with ESMTP id 05J7EAtP011438 for ; Fri, 19 Jun 2020 03:14:10 -0400 Received: from mail-qv1-f71.google.com (mail-qv1-f71.google.com [209.85.219.71]) by mr1.cc.vt.edu (8.14.7/8.14.7) with ESMTP id 05J7E5CV015386 for ; Fri, 19 Jun 2020 03:14:10 -0400 Received: by mail-qv1-f71.google.com with SMTP id z7so6017825qve.0 for ; Fri, 19 Jun 2020 00:14:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:in-reply-to:references :mime-version:content-transfer-encoding:date:message-id; bh=g8SnvPZe6QKmz8NhbaTdqA+70Tm7ugP3MdJCqzozz/o=; b=Ydx2MEaumRqUUXbXxXJFWSaUk6lUu+KfMcRo9JsI7tqPMqUVp2SUYTtegaOWMuuH5i c20XNqcdDeZJsAlz0dkRWtTBypwwtXPaAXM0kcpvHD5pwICF1Xmx7wRdFD5I5ACWj2/Z YUQror1GhS2pFo7NhhU82ZWC+ock+VlUMvRRcbdDdkBmhAVF1RliTtCD/ak7e0quP2Sc Ub8ZP9iG7Z/Fv3pHp0iLFyRxH3pWWIeSIZ/oopIbn2HelqhnKQjU3B1aroAuhueGH8Yr KLBb13z97wQS3ViFn/q22B7AA9jrhGHiNztqEq5VShNY0F3BcfVGy1C4cez0TbV2K7Ix g2Kw== X-Gm-Message-State: AOAM531ULXT16JeV5Z1FXf9y6+6qXRHNZFg9n8IiQGlx0+zYXpWE4GEk MsSbC42hv9H/DkMazN8dVN8mxBAo/Ptxca7+CcqWLjXIHNGmObl7A0yPa3RJtVNygGVchViKlEC oQDHB36J7yoD4P5bGadLxUvVtCnh9iSbmwHRJAG0= X-Received: by 2002:a05:6214:6b2:: with SMTP id s18mr6970888qvz.135.1592550844757; Fri, 19 Jun 2020 00:14:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz8hpFc8gE8yraW9TRr4jA1JbMP4lj1wb3SvzLmfJcUSXvB7vXl/xMnIxUvBJ23aMp0YjBoSQ== X-Received: by 2002:a05:6214:6b2:: with SMTP id s18mr6970876qvz.135.1592550844355; Fri, 19 Jun 2020 00:14:04 -0700 (PDT) Received: from turing-police ([2601:5c0:c001:c9e1::359]) by smtp.gmail.com with UTF8SMTPSA id q69sm5398590qke.66.2020.06.19.00.14.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jun 2020 00:14:02 -0700 (PDT) From: "Valdis Kl=?utf-8?Q?=c4=93?=tnieks" X-Google-Original-From: "Valdis Kl=?utf-8?Q?=c4=93?=tnieks" X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7+dev To: 孙世龙 sunshilong Subject: Re: Why does “page allocation failure” occur whereas there are still “58*4096kB (C)” could be used? In-Reply-To: References: <459330.1592542115@turing-police> Mime-Version: 1.0 Date: Fri, 19 Jun 2020 03:14:02 -0400 Message-ID: <466244.1592550842@turing-police> Cc: Kernelnewbies@kernelnewbies.org X-BeenThere: kernelnewbies@kernelnewbies.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Learn about the Linux kernel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============5275760926947716507==" Errors-To: kernelnewbies-bounces@kernelnewbies.org --===============5275760926947716507== Content-Type: multipart/signed; boundary="==_Exmh_1592550841_62491P"; micalg=pgp-sha1; protocol="application/pgp-signature" Content-Transfer-Encoding: 7bit --==_Exmh_1592550841_62491P Content-Type: text/plain; charset=us-ascii On Fri, 19 Jun 2020 14:56:20 +0800, 孙世龙 sunshilong said: > Why doesn't the kernel use two memory blocks whose size is 2048KB(i.e.*oder 9 *) > instead of one block *order 10 *(you see, there are still three free blocks and > 2048KB*2=4096KB equivalent to the memory size of order 10)? Most parts of the kernel, when asking for very high-order allocations, *will* have a fallback strategy to use smaller chunks. So, for instance, if a device need a 1M buffer and supports scatter-gather operations, if 1M of contiguous memory isn't available, the kernel can ask for 4 256K chunks and have the I/O directed into the 4 areas. However, if the memory *has* to be contiguous (for example, no scatter/gather available, or it's for an array data structure), then it can't do that. And in fact, that fallback could very well have happened in this case - I didn't bother chasing back to see if the gadget driver does recovery by allocating multiple smaller chunks. (That's a good "exercise for the student"... :) --==_Exmh_1592550841_62491P Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Comment: Exmh version 2.9.0 11/07/2018 iQIVAwUBXuxluQdmEQWDXROgAQIFVg/+NYLUpZ2KMaV2usRcUjDZ168k8b7y4mDB 9hQDhrjjJaPfR6DmY0RjovQFTrhIw3wN5uq0fqwzbbYbYbOrVUMpe1OGt1TlLFnp +j/es3SMnZY8afRzfYStLgSzx0uozOCeF5B2IlgzH+qriY1WrHfI+6gbbaeoghla BWsfjLyylBEsr1Xsq53y4OvKxXEM5zTULhyj206HUkiLu4TfLN90DBB8SWzRnuKU okNK9F+8cNfK7N69Ez8T1jAQh1tij9tf7qD3DalpS2SWcDhDB0/+H22I6YdJIM77 l5dwY+N49f2h3pRAMNhQa2ekRyAQ5VXj9cdawFHfOZ/SPyNvD3FpeHG10p+vtTB2 H7cHVdwI8CwWNuVtyb6UdFHC6FyEYMpl/tF896cyBOUkj7CoYa52FlIyagLsZFZt o9KquHYDkIoSiVPLRUdWxVi2Vimmd0FRwKVrUptRtsLAtgkSvxUQhqrSSrFRKSSo Ussqg+6ru2dSFxqZD4I81VQHoaftxpIh/9nxbKDDFPbuoRS9wUJ1kn3Cg/pIquMf BMftqok3kAG5PaZ+6ZjN1HSzurfKHMCFu3mhNIl+QMSQ0mwrNlLLVKSb4tUkXJnT fZNdrhepfeV6b6P+oA9u1ED7bix2imcLWFVAjRYSbsJaav7gASjhsGk90q3hSsZH LZpQjqBTbi0= =qfls -----END PGP SIGNATURE----- --==_Exmh_1592550841_62491P-- --===============5275760926947716507== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies --===============5275760926947716507==--