get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/2196357/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 2196357,
    "url": "http://patchwork.ozlabs.org/api/patches/2196357/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/ltp/patch/20260213145200.23935-1-mdoucha@suse.cz/",
    "project": {
        "id": 59,
        "url": "http://patchwork.ozlabs.org/api/projects/59/?format=api",
        "name": "Linux Test Project development",
        "link_name": "ltp",
        "list_id": "ltp.lists.linux.it",
        "list_email": "ltp@lists.linux.it",
        "web_url": "",
        "scm_url": "",
        "webscm_url": "",
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20260213145200.23935-1-mdoucha@suse.cz>",
    "list_archive_url": null,
    "date": "2026-02-13T14:51:54",
    "name": "readahead02: Always allow at least 100ms for cache to fill",
    "commit_ref": null,
    "pull_url": null,
    "state": "needs-review-ack",
    "archived": false,
    "hash": "96437060c6085302bd6c9b142687dc72f015a126",
    "submitter": {
        "id": 77472,
        "url": "http://patchwork.ozlabs.org/api/people/77472/?format=api",
        "name": "Martin Doucha",
        "email": "mdoucha@suse.cz"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/ltp/patch/20260213145200.23935-1-mdoucha@suse.cz/mbox/",
    "series": [
        {
            "id": 492109,
            "url": "http://patchwork.ozlabs.org/api/series/492109/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/ltp/list/?series=492109",
            "date": "2026-02-13T14:51:54",
            "name": "readahead02: Always allow at least 100ms for cache to fill",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/492109/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2196357/comments/",
    "check": "success",
    "checks": "http://patchwork.ozlabs.org/api/patches/2196357/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it>",
        "X-Original-To": [
            "incoming@patchwork.ozlabs.org",
            "ltp@lists.linux.it"
        ],
        "Delivered-To": [
            "patchwork-incoming@legolas.ozlabs.org",
            "ltp@picard.linux.it"
        ],
        "Authentication-Results": [
            "legolas.ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n unprotected) header.d=suse.cz header.i=@suse.cz header.a=rsa-sha256\n header.s=susede2_rsa header.b=r2ppAqQj;\n\tdkim=fail reason=\"signature verification failed\" header.d=suse.cz\n header.i=@suse.cz header.a=ed25519-sha256 header.s=susede2_ed25519\n header.b=AoTNED7U;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key)\n header.d=suse.cz header.i=@suse.cz header.a=rsa-sha256 header.s=susede2_rsa\n header.b=r2ppAqQj;\n\tdkim=neutral header.d=suse.cz header.i=@suse.cz header.a=ed25519-sha256\n header.s=susede2_ed25519 header.b=AoTNED7U;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.linux.it\n (client-ip=2001:1418:10:5::2; helo=picard.linux.it;\n envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it;\n receiver=patchwork.ozlabs.org)",
            "smtp-out1.suse.de;\n dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=r2ppAqQj;\n dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=AoTNED7U"
        ],
        "Received": [
            "from picard.linux.it (picard.linux.it [IPv6:2001:1418:10:5::2])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fCFWJ1CMqz1xpl\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 14 Feb 2026 01:52:10 +1100 (AEDT)",
            "from picard.linux.it (localhost [IPv6:::1])\n\tby picard.linux.it (Postfix) with ESMTP id A286A3CF960\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 13 Feb 2026 15:52:07 +0100 (CET)",
            "from in-5.smtp.seeweb.it (in-5.smtp.seeweb.it\n [IPv6:2001:4b78:1:20::5])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature ECDSA (secp384r1))\n (No client certificate requested)\n by picard.linux.it (Postfix) with ESMTPS id 9005A3CE774\n for <ltp@lists.linux.it>; Fri, 13 Feb 2026 15:52:03 +0100 (CET)",
            "from smtp-out1.suse.de (smtp-out1.suse.de\n [IPv6:2a07:de40:b251:101:10:150:64:1])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest\n SHA256)\n (No client certificate requested)\n by in-5.smtp.seeweb.it (Postfix) with ESMTPS id CE650600E3E\n for <ltp@lists.linux.it>; Fri, 13 Feb 2026 15:52:02 +0100 (CET)",
            "from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org\n [IPv6:2a07:de40:b281:104:10:150:64:97])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest\n SHA256)\n (No client certificate requested)\n by smtp-out1.suse.de (Postfix) with ESMTPS id 18EA03E74B\n for <ltp@lists.linux.it>; Fri, 13 Feb 2026 14:52:01 +0000 (UTC)",
            "from imap1.dmz-prg2.suse.org (localhost [127.0.0.1])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest\n SHA256)\n (No client certificate requested)\n by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 06CF73EA62\n for <ltp@lists.linux.it>; Fri, 13 Feb 2026 14:52:01 +0000 (UTC)",
            "from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167])\n by imap1.dmz-prg2.suse.org with ESMTPSA id BieEAZE6j2lVYQAAD6G6ig\n (envelope-from <mdoucha@suse.cz>)\n for <ltp@lists.linux.it>; Fri, 13 Feb 2026 14:52:01 +0000"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz;\n s=susede2_rsa;\n t=1770994321; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:\n mime-version:mime-version:\n content-transfer-encoding:content-transfer-encoding;\n bh=Qk5lIKzZWkweO2pHYuIiVAWTAYIc97XJwI4eAnIDZW8=;\n b=r2ppAqQj05tegi88jLoJc2IkHkRq4KSB9yf98XmlTz9oHscuCnJd/flayjHOosv5lyjdwq\n GFSZeQDZoyf/nK6CY1nyFe37XJcsvhTNM2CUH9qfq8Wv4co+4lh8H+kKP6lcPTYch1WPRw\n +VN9Hk3uAANWBW/aLS3yASW37CWtTY4=",
            "v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz;\n s=susede2_ed25519; t=1770994321;\n h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:\n mime-version:mime-version:\n content-transfer-encoding:content-transfer-encoding;\n bh=Qk5lIKzZWkweO2pHYuIiVAWTAYIc97XJwI4eAnIDZW8=;\n b=AoTNED7UemTnQgjaPTihZhXAt9B/b2/QOB9FWdkIksSUbrTWMduQ42NCYJm8MmWXxFndZO\n KZ8fk90U1S6DHjBw==",
            "v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz;\n s=susede2_rsa;\n t=1770994321; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:\n mime-version:mime-version:\n content-transfer-encoding:content-transfer-encoding;\n bh=Qk5lIKzZWkweO2pHYuIiVAWTAYIc97XJwI4eAnIDZW8=;\n b=r2ppAqQj05tegi88jLoJc2IkHkRq4KSB9yf98XmlTz9oHscuCnJd/flayjHOosv5lyjdwq\n GFSZeQDZoyf/nK6CY1nyFe37XJcsvhTNM2CUH9qfq8Wv4co+4lh8H+kKP6lcPTYch1WPRw\n +VN9Hk3uAANWBW/aLS3yASW37CWtTY4=",
            "v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz;\n s=susede2_ed25519; t=1770994321;\n h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:\n mime-version:mime-version:\n content-transfer-encoding:content-transfer-encoding;\n bh=Qk5lIKzZWkweO2pHYuIiVAWTAYIc97XJwI4eAnIDZW8=;\n b=AoTNED7UemTnQgjaPTihZhXAt9B/b2/QOB9FWdkIksSUbrTWMduQ42NCYJm8MmWXxFndZO\n KZ8fk90U1S6DHjBw=="
        ],
        "From": "Martin Doucha <mdoucha@suse.cz>",
        "To": "ltp@lists.linux.it",
        "Date": "Fri, 13 Feb 2026 15:51:54 +0100",
        "Message-ID": "<20260213145200.23935-1-mdoucha@suse.cz>",
        "X-Mailer": "git-send-email 2.52.0",
        "MIME-Version": "1.0",
        "X-Spamd-Result": "default: False [-3.01 / 50.00]; BAYES_HAM(-3.00)[100.00%];\n MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000];\n R_MISSING_CHARSET(0.50)[];\n R_DKIM_ALLOW(-0.20)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519];\n NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain];\n MX_GOOD(-0.01)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; ARC_NA(0.00)[];\n RCPT_COUNT_ONE(0.00)[1]; FUZZY_RATELIMITED(0.00)[rspamd.com];\n MIME_TRACE(0.00)[0:+];\n RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from];\n DKIM_SIGNED(0.00)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519];\n RCVD_TLS_ALL(0.00)[]; DKIM_TRACE(0.00)[suse.cz:+];\n RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[];\n FROM_HAS_DN(0.00)[];\n SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from];\n TO_DN_NONE(0.00)[];\n PREVIOUSLY_DELIVERED(0.00)[ltp@lists.linux.it];\n DNSWL_BLOCKED(0.00)[2a07:de40:b281:104:10:150:64:97:from,2a07:de40:b281:106:10:150:64:167:received];\n RCVD_VIA_SMTP_AUTH(0.00)[];\n RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received];\n DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,\n imap1.dmz-prg2.suse.org:rdns]",
        "X-Spam-Score": "-3.01",
        "X-Rspamd-Queue-Id": "18EA03E74B",
        "X-Rspamd-Action": "no action",
        "X-Rspamd-Server": "rspamd2.dmz-prg2.suse.org",
        "X-Spam-Level": "",
        "X-Spam-Status": "No, score=0.1 required=7.0 tests=DKIM_SIGNED,DKIM_VALID,\n DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS shortcircuit=no\n autolearn=disabled version=4.0.1",
        "X-Spam-Checker-Version": "SpamAssassin 4.0.1 (2024-03-25) on in-5.smtp.seeweb.it",
        "X-Virus-Scanned": "clamav-milter 1.0.9 at in-5.smtp.seeweb.it",
        "X-Virus-Status": "Clean",
        "Subject": "[LTP] [PATCH] readahead02: Always allow at least 100ms for cache to\n fill",
        "X-BeenThere": "ltp@lists.linux.it",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "Linux Test Project <ltp.lists.linux.it>",
        "List-Unsubscribe": "<https://lists.linux.it/options/ltp>,\n <mailto:ltp-request@lists.linux.it?subject=unsubscribe>",
        "List-Archive": "<http://lists.linux.it/pipermail/ltp/>",
        "List-Post": "<mailto:ltp@lists.linux.it>",
        "List-Help": "<mailto:ltp-request@lists.linux.it?subject=help>",
        "List-Subscribe": "<https://lists.linux.it/listinfo/ltp>,\n <mailto:ltp-request@lists.linux.it?subject=subscribe>",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Errors-To": "ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it",
        "Sender": "\"ltp\" <ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it>"
    },
    "content": "The current wait algorithm for filling the cache after readahead()\nwill never retry if the cache doesn't start filling within 15ms.\nRewrite the wait loop to always allow at least 100ms for the cache\nto fill and exit early only if cache increased by at least half\nof the expected amount. This fixes random test failures if the interval\nbetween cache increases is longer than 5ms.\n\nSigned-off-by: Martin Doucha <mdoucha@suse.cz>\n---\n .../kernel/syscalls/readahead/readahead02.c   | 45 +++++++++----------\n 1 file changed, 20 insertions(+), 25 deletions(-)",
    "diff": "diff --git a/testcases/kernel/syscalls/readahead/readahead02.c b/testcases/kernel/syscalls/readahead/readahead02.c\nindex 8dbcec2e7..5f7ab076b 100644\n--- a/testcases/kernel/syscalls/readahead/readahead02.c\n+++ b/testcases/kernel/syscalls/readahead/readahead02.c\n@@ -38,8 +38,8 @@ static char testfile[PATH_MAX] = \"testfile\";\n #define DROP_CACHES_FNAME \"/proc/sys/vm/drop_caches\"\n #define PROC_IO_FNAME \"/proc/self/io\"\n #define DEFAULT_FILESIZE (64 * 1024 * 1024)\n-#define INITIAL_SHORT_SLEEP_US 10000\n #define SHORT_SLEEP_US 5000\n+#define MIN_SLEEP_LIMIT 20\n \n static size_t testfile_size = DEFAULT_FILESIZE;\n static char *opt_fsizestr;\n@@ -193,12 +193,20 @@ static int read_testfile(struct tcase *tc, int do_readahead,\n \tlong read_bytes_start;\n \tunsigned char *p, tmp;\n \toff_t offset = 0;\n-\tunsigned long cached_prev = 0, cached_cur = 0;\n+\tsize_t cached_prev;\n+\tssize_t cache_diff;\n \n \tfd = SAFE_OPEN(fname, O_RDONLY);\n \n \tif (do_readahead) {\n \t\tdo {\n+\t\t\tcached_prev = get_file_cached_bytes(fname, fsize);\n+\t\t\ttst_res(TDEBUG, \"Per-file cached: %lu kB\",\n+\t\t\t\tcached_prev / 1024);\n+\n+\t\t\tif (cached_prev >= fsize)\n+\t\t\t\tbreak;\n+\n \t\t\tTEST(tc->readahead(fd, offset, fsize - offset));\n \t\t\tif (TST_RET != 0) {\n \t\t\t\tSAFE_CLOSE(fd);\n@@ -207,40 +215,27 @@ static int read_testfile(struct tcase *tc, int do_readahead,\n \n \t\t\ti++;\n \t\t\toffset += readahead_length;\n-\t\t\t/* Wait a bit so that the readahead() has chance to start. */\n-\t\t\tusleep(INITIAL_SHORT_SLEEP_US);\n \t\t\t/*\n \t\t\t * We assume that the worst case I/O speed is around\n-\t\t\t * 5MB/s which is roughly 5 bytes per 1 us, which gives\n+\t\t\t * 5MB/s which is roughly 5 bytes per 1 us and we\n+\t\t\t * allow additional 25ms for seeks, which gives\n \t\t\t * us upper bound for retries that is\n-\t\t\t * readahead_size/(5 * SHORT_SLEEP_US).\n+\t\t\t * 5 + readahead_size/(5 * SHORT_SLEEP_US).\n \t\t\t *\n-\t\t\t * We also monitor the cache size increases before and\n-\t\t\t * after the sleep. With the same assumption about the\n-\t\t\t * speed we are supposed to read at least 5 *\n-\t\t\t * SHORT_SLEEP_US bytes during that time. That amound\n-\t\t\t * is genreally quite close a page size so that we just\n-\t\t\t * assume that we sould continue as long as the cache\n-\t\t\t * increases.\n-\t\t\t *\n-\t\t\t * Of course all of this is inprecise on multitasking\n-\t\t\t * OS however even on a system where there are several\n-\t\t\t * processes figthing for I/O this loop will wait as\n-\t\t\t * long a cache is increasing which will gives us high\n-\t\t\t * chance of waiting for the readahead to happen.\n+\t\t\t * We also monitor the cache size and exit the wait\n+\t\t\t * loop early if it increases by at least 50%\n+\t\t\t * of the read ahead size.\n \t\t\t */\n-\t\t\tcached_cur = get_file_cached_bytes(fname, fsize);\n \t\t\tint retries = readahead_length / (5 * SHORT_SLEEP_US);\n \n-\t\t\ttst_res(TDEBUG, \"Per-file cached: %lu kB\", cached_cur / 1024);\n+\t\t\tretries = MAX(retries + 5, MIN_SLEEP_LIMIT);\n \n \t\t\tdo {\n \t\t\t\tusleep(SHORT_SLEEP_US);\n+\t\t\t\tcache_diff = get_file_cached_bytes(fname,\n+\t\t\t\t\tfsize) - cached_prev;\n \n-\t\t\t\tcached_prev = cached_cur;\n-\t\t\t\tcached_cur = get_file_cached_bytes(fname, fsize);\n-\n-\t\t\t\tif (cached_cur <= cached_prev)\n+\t\t\t\tif (cache_diff >= readahead_length / 2)\n \t\t\t\t\tbreak;\n \t\t\t} while (retries-- > 0);\n \n",
    "prefixes": []
}